code::LBWriter Class Reference

Inheritance diagram for code::LBWriter:

code::Writer List of all members.

Detailed Description

LBWriter can be used to write a message to a Linear Buffer.

By specifying a message id, it can be used to replace a specific message.

Author:
: Lakshman
Version:
:
Id
code_LBWriter.h,v 1.6 2009/06/02 20:17:38 lakshman Exp


Public Member Functions

virtual int writeOut (const Buffer &buf, const char *lbName, const char *messageId) const
 Writes a given buffer out to the LB.
virtual ~LBWriter ()
 Empty virtual destructor, to permit subclassing.
int writeOut (const Buffer &b, const std::string &dev, const std::string &msg) const
int writeOut (const Buffer &b, const std::string &filename) const
int writeXMLDocument (const XML::Document &, const std::string &deviceName, const std::string &messageName)
 Given a document created from its root element, the contents (in textual form) will be written out.

Static Public Member Functions

static void introduceSelf ()
 Announces itself to the system.
static SmartPtr< WritergetWriter (const std::string &)
 Obtain the storage type's Writer.

Protected Member Functions

 LBWriter ()
 The default constructor should be used only by subclasses.


Constructor & Destructor Documentation

virtual code::LBWriter::~LBWriter (  )  [inline, virtual]

Empty virtual destructor, to permit subclassing.

code::LBWriter::LBWriter (  )  [inline, protected]

The default constructor should be used only by subclasses.

All others should use the factory method getWriter().


Member Function Documentation

static SmartPtr< Writer > code::Writer::getWriter ( const std::string &   )  [static, inherited]

Obtain the storage type's Writer.

Pass in as StorageType::FlatFile, etc. Of course, you can pass in the std::string itself.

On error, return SmartPtr that evaluates to NULL (or 0).

Parameters:
const_string& storage type

static void code::LBWriter::introduceSelf (  )  [inline, static]

Announces itself to the system.

This function needs to be invoked before LBWriter can be used. In the case of baseline CODE, it will be invoked by the initialize function of Introducer. For new development, it has to be done explicitly.

int code::Writer::writeOut ( const Buffer b,
const std::string &  filename 
) const [inline, inherited]

int code::Writer::writeOut ( const Buffer b,
const std::string &  dev,
const std::string &  msg 
) const [inline, inherited]

virtual int code::LBWriter::writeOut ( const Buffer buf,
const char *  lbName,
const char *  messageId 
) const [virtual]

Writes a given buffer out to the LB.

Parameters:
buf The buffer of characters to write out.
lbName The name of the LB (attach machinename:, if remote)
messageId The id of message to replace. Pass in a negative number to write as the next message in the LB. Note that LB requires that replacing messages are the same size as the message to be replaced.
Returns:
zero on success and negative on error.

Implements code::Writer.

int code::Writer::writeXMLDocument ( const XML::Document ,
const std::string &  deviceName,
const std::string &  messageName 
) [inherited]

Given a document created from its root element, the contents (in textual form) will be written out.

This method writes out the entire document.

See also:
XMLOutputter

XMLDocument

Returns:
zero on success and negative on error.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7