XRootD
XrdCl::Message Class Reference

The message representation used throughout the system. More...

#include <XrdClMessage.hh>

+ Inheritance diagram for XrdCl::Message:
+ Collaboration diagram for XrdCl::Message:

Public Member Functions

 Message (Message &&msg)
 Move Constructor. More...
 
 Message (uint32_t size=0)
 Constructor. More...
 
virtual ~Message ()
 Destructor. More...
 
const std::string & GetDescription () const
 Get the description of the message. More...
 
const std::string & GetObfuscatedDescription () const
 Get the description of the message with authz parameter obfuscated. More...
 
uint64_t GetSessionId () const
 Get the session ID the message is meant for. More...
 
uint16_t GetVirtReqID () const
 Get virtual request ID for the message. More...
 
bool IsMarshalled () const
 Check if the message is marshalled. More...
 
Messageoperator= (Message &&msg)
 Move assignment operator. More...
 
void SetDescription (const std::string &description)
 Set the description of the message. More...
 
void SetIsMarshalled (bool isMarshalled)
 Set the marshalling status. More...
 
void SetSessionId (uint64_t sessionId)
 Set the session ID which this message is meant for. More...
 
void SetVirtReqID (uint16_t virtReqID)
 Set virtual request ID for the message. More...
 
- Public Member Functions inherited from XrdCl::Buffer
 Buffer (Buffer &&buffer)
 Move Constructor. More...
 
 Buffer (uint32_t size=0)
 Constructor. More...
 
virtual ~Buffer ()
 Destructor. More...
 
void AdvanceCursor (uint32_t delta)
 Advance the cursor. More...
 
void Allocate (uint32_t size)
 Allocate the buffer. More...
 
void Append (const char *buffer, uint32_t size)
 Append data at the position pointed to by the append cursor. More...
 
void Append (const char *buffer, uint32_t size, uint32_t offset)
 Append data at the given offset. More...
 
void Free ()
 Free the buffer. More...
 
void FromString (const std::string str)
 Fill the buffer from a string. More...
 
char * GetBuffer (uint32_t offset=0)
 Get the message buffer. More...
 
const char * GetBuffer (uint32_t offset=0) const
 Get the message buffer. More...
 
char * GetBufferAtCursor ()
 Get the buffer pointer at the append cursor. More...
 
const char * GetBufferAtCursor () const
 Get the buffer pointer at the append cursor. More...
 
uint32_t GetCursor () const
 Get append cursor. More...
 
uint32_t GetSize () const
 Get the size of the message. More...
 
void Grab (char *buffer, uint32_t size)
 Grab a buffer allocated outside. More...
 
Bufferoperator= (Buffer &&buffer)
 Move assignment operator. More...
 
void ReAllocate (uint32_t size)
 Reallocate the buffer to a new location of a given size. More...
 
char * Release ()
 Release the buffer. More...
 
void SetCursor (uint32_t cursor)
 Set the cursor. More...
 
std::string ToString () const
 Convert the buffer to a string. More...
 
void Zero ()
 Zero. More...
 

Additional Inherited Members

- Protected Member Functions inherited from XrdCl::Buffer
void Steal (Buffer &&buffer)
 

Detailed Description

The message representation used throughout the system.

Definition at line 31 of file XrdClMessage.hh.

Constructor & Destructor Documentation

◆ Message() [1/2]

XrdCl::Message::Message ( uint32_t  size = 0)
inline

Constructor.

Definition at line 37 of file XrdClMessage.hh.

37  :
38  Buffer( size ), pIsMarshalled( false ), pSessionId(0), pVirtReqID( 0 )
39  {
40  if( size )
41  Zero();
42  }
Buffer(uint32_t size=0)
Constructor.
Definition: XrdClBuffer.hh:39
void Zero()
Zero.
Definition: XrdClBuffer.hh:124

References XrdCl::Buffer::Zero().

+ Here is the call graph for this function:

◆ Message() [2/2]

XrdCl::Message::Message ( Message &&  msg)
inline

Move Constructor.

Definition at line 47 of file XrdClMessage.hh.

47  :
48  Buffer( std::move( msg ) ), pIsMarshalled( msg.pIsMarshalled ),
49  pSessionId( std::move( msg.pSessionId ) ), pVirtReqID( msg.pVirtReqID )
50  {
51  }

◆ ~Message()

virtual XrdCl::Message::~Message ( )
inlinevirtual

Destructor.

Definition at line 68 of file XrdClMessage.hh.

68 {}

Member Function Documentation

◆ GetDescription()

const std::string& XrdCl::Message::GetDescription ( ) const
inline

Get the description of the message.

Definition at line 98 of file XrdClMessage.hh.

99  {
100  return pDescription;
101  }

◆ GetObfuscatedDescription()

const std::string& XrdCl::Message::GetObfuscatedDescription ( ) const
inline

◆ GetSessionId()

uint64_t XrdCl::Message::GetSessionId ( ) const
inline

Get the session ID the message is meant for.

Definition at line 122 of file XrdClMessage.hh.

123  {
124  return pSessionId;
125  }

Referenced by XrdCl::XRootDMsgHandler::XRootDMsgHandler(), and XrdCl::Stream::Send().

+ Here is the caller graph for this function:

◆ GetVirtReqID()

uint16_t XrdCl::Message::GetVirtReqID ( ) const
inline

Get virtual request ID for the message.

Definition at line 138 of file XrdClMessage.hh.

139  {
140  return pVirtReqID;
141  }

Referenced by XrdCl::LocalFileHandler::ExecRequest(), and XrdCl::AsyncRawReader::GetResponse().

+ Here is the caller graph for this function:

◆ IsMarshalled()

bool XrdCl::Message::IsMarshalled ( ) const
inline

Check if the message is marshalled.

Definition at line 73 of file XrdClMessage.hh.

74  {
75  return pIsMarshalled;
76  }

Referenced by XrdCl::XRootDTransport::UnMarshallRequest().

+ Here is the caller graph for this function:

◆ operator=()

Message& XrdCl::Message::operator= ( Message &&  msg)
inline

Move assignment operator.

Definition at line 56 of file XrdClMessage.hh.

57  {
58  Steal( std::move( msg ) );
59  pIsMarshalled = msg.pIsMarshalled;
60  pSessionId = std::move( msg.pSessionId );
61  pVirtReqID = msg.pVirtReqID;
62  return *this;
63  }
void Steal(Buffer &&buffer)
Definition: XrdClBuffer.hh:249

References XrdCl::Buffer::Steal().

+ Here is the call graph for this function:

◆ SetDescription()

void XrdCl::Message::SetDescription ( const std::string &  description)
inline

Set the description of the message.

Definition at line 89 of file XrdClMessage.hh.

90  {
91  pDescription = description;
92  pObfuscatedDescription = obfuscateAuth(description);
93  }
std::string obfuscateAuth(const std::string &input)

References obfuscateAuth().

Referenced by XrdCl::XRootDTransport::SetDescription().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetIsMarshalled()

void XrdCl::Message::SetIsMarshalled ( bool  isMarshalled)
inline

Set the marshalling status.

Definition at line 81 of file XrdClMessage.hh.

82  {
83  pIsMarshalled = isMarshalled;
84  }

Referenced by XrdCl::XRootDTransport::MarshallRequest(), and XrdCl::XRootDTransport::UnMarshallRequest().

+ Here is the caller graph for this function:

◆ SetSessionId()

void XrdCl::Message::SetSessionId ( uint64_t  sessionId)
inline

Set the session ID which this message is meant for.

Definition at line 114 of file XrdClMessage.hh.

115  {
116  pSessionId = sessionId;
117  }

Referenced by XrdCl::FileStateHandler::Close().

+ Here is the caller graph for this function:

◆ SetVirtReqID()

void XrdCl::Message::SetVirtReqID ( uint16_t  virtReqID)
inline

Set virtual request ID for the message.

Definition at line 130 of file XrdClMessage.hh.

131  {
132  pVirtReqID = virtReqID;
133  }

Referenced by XrdCl::FileStateHandler::ReadV().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: