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...
 
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 29 of file XrdClMessage.hh.

Constructor & Destructor Documentation

◆ Message() [1/2]

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

Constructor.

Definition at line 35 of file XrdClMessage.hh.

35  :
36  Buffer( size ), pIsMarshalled( false ), pSessionId(0), pVirtReqID( 0 )
37  {
38  if( size )
39  Zero();
40  }
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 45 of file XrdClMessage.hh.

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

◆ ~Message()

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

Destructor.

Definition at line 66 of file XrdClMessage.hh.

66 {}

Member Function Documentation

◆ GetDescription()

◆ GetSessionId()

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

Get the session ID the message is meant for.

Definition at line 111 of file XrdClMessage.hh.

112  {
113  return pSessionId;
114  }

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 127 of file XrdClMessage.hh.

128  {
129  return pVirtReqID;
130  }

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 71 of file XrdClMessage.hh.

72  {
73  return pIsMarshalled;
74  }

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 54 of file XrdClMessage.hh.

55  {
56  Steal( std::move( msg ) );
57  pIsMarshalled = msg.pIsMarshalled;
58  pSessionId = std::move( msg.pSessionId );
59  pVirtReqID = msg.pVirtReqID;
60  return *this;
61  }
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 87 of file XrdClMessage.hh.

88  {
89  pDescription = description;
90  }

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

+ Here is the caller graph for this function:

◆ SetIsMarshalled()

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

Set the marshalling status.

Definition at line 79 of file XrdClMessage.hh.

80  {
81  pIsMarshalled = isMarshalled;
82  }

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 103 of file XrdClMessage.hh.

104  {
105  pSessionId = sessionId;
106  }

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 119 of file XrdClMessage.hh.

120  {
121  pVirtReqID = virtReqID;
122  }

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

+ Here is the caller graph for this function:

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