Data Class Reference

A sub-class of Message that makes it more clear that this Message object only exists as a chunk of data. More...

#include <message.h>

Inheritance diagram for Data:

Inheritance graph
[legend]
Collaboration diagram for Data:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Data (u_char *d, size_t l)
 Data (const Data &d)
 Data (const std::string &s)
virtual ~Data ()
const u_char * data (void) const
 Return a pointer to the data contained in this message.
size_t len (void) const
 Return the length of the data we're holding.


Detailed Description

A sub-class of Message that makes it more clear that this Message object only exists as a chunk of data.

RTTI can help us determine this rather than checking Message::typ, and it makes the code a little more clear, I think.

Note:
Is this really true? Or would it be better just to use Message in it's natural form for this? Does the subclassing make either the clarity of code enough better/easier that this is worth having?

Definition at line 132 of file message.h.


Constructor & Destructor Documentation

Data::Data ( u_char *  d,
size_t  l 
) [inline]

Definition at line 135 of file message.h.

Data::Data ( const Data d  ) 

Definition at line 141 of file message.cc.

References Message::alloc_data(), data(), len(), and Message::privdata.

Here is the call graph for this function:

Data::Data ( const std::string &  s  )  [inline]

Definition at line 142 of file message.h.

virtual Data::~Data (  )  [inline, virtual]

Definition at line 144 of file message.h.


Member Function Documentation

const u_char * Data::data ( void   )  const

Return a pointer to the data contained in this message.

Return the actual data pointer...

Note:
This is dangerous. Do we need to do this?
This function is dangerous, as it allows direct access. This should be changed.

Definition at line 97 of file message.cc.

References Message::privdata.

Referenced by Data(), UserTTYConn::handle_oob_sequence(), operator<<(), TTYConnector::write(), History::write(), and FDConnector::write().

Here is the caller graph for this function:

size_t Data::len ( void   )  const

Return the length of the data we're holding.

Return the length of the data contained in this message.

Definition at line 104 of file message.cc.

References Message::length.

Referenced by Data(), UserTTYConn::handle_oob_sequence(), operator<<(), BiDirConn::reader(), TTYConnector::write(), History::write(), and FDConnector::write().

Here is the caller graph for this function:


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

Generated on Tue May 13 11:32:45 2008 for consmgr by  doxygen 1.5.5