Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TAO_Notify::XML_Saver Class Reference

Save Notification Service Topology to an XML file. More...

#include <XML_Saver.h>

Inheritance diagram for TAO_Notify::XML_Saver:

Inheritance graph
[legend]
Collaboration diagram for TAO_Notify::XML_Saver:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XML_Saver (bool timestamp=true)
virtual ~XML_Saver ()
bool open (const ACE_CString &file_name, size_t backup_count)
virtual bool begin_object (CORBA::Long id, const ACE_CString &type, const NVPList &attrs, bool changed ACE_ENV_ARG_DECL)
 Begin the storage of an object.
virtual void end_object (CORBA::Long id, const ACE_CString &type ACE_ENV_ARG_DECL)
 End the storage of an object.
virtual void close (ACE_ENV_SINGLE_ARG_DECL)
 Close the saver.

Private Member Functions

void backup_file_name (char *file_path, int nfile)
char * escape_string (char *&newstr, size_t &size, const ACE_CString &str)
 newstr to allow in-line use

Private Attributes

FILE * output_
 A stream representing our current output.
bool close_out_
ACE_CString base_name_
 the name of the output file
size_t backup_count_
bool timestamp_
 true to enable timestamping
ACE_CString indent_
 A string consisting of spaces that is our current indentation level.

Detailed Description

Save Notification Service Topology to an XML file.


Constructor & Destructor Documentation

TAO_Notify::XML_Saver::XML_Saver bool  timestamp = true  ) 
 

Construct an XML_Saver. Initialization is deferred to "open()"

TAO_Notify::XML_Saver::~XML_Saver  )  [virtual]
 


Member Function Documentation

void TAO_Notify::XML_Saver::backup_file_name char *  file_path,
int  nfile
[private]
 

virtual bool TAO_Notify::XML_Saver::begin_object CORBA::Long  id,
const ACE_CString type,
const NVPList attrs,
bool changed  ACE_ENV_ARG_DECL
[virtual]
 

Begin the storage of an object.

Call this function with the type and ID of an object to be stored. This object may have children, and this will necessitate nested calls to begin_object. Design principle: Names should be descriptive enough to allow the objects' parent to create an instance of the desired class. This instance will be registered with the poa using the id. The instance itself should will load its own attributes. Example <proxy type="push_supplier" events="any" id="20"...> is not a good design because the name "proxy" is not descriptive enough. "<structured_proxy_push_supplier id="20"...> is better because this allows the parent to create the correct type of object without decoding attributes.

Parameters:
id numeric id for this object
type string containing the unique type name for this class of objects
attrs a collection of name/value attributes
change true if this object's attributes have changed.
Returns:
bool want_all_children. If true even changed children should be saved.

Implements TAO_Notify::Topology_Saver.

void TAO_Notify::XML_Saver::close ACE_ENV_SINGLE_ARG_DECL   )  [virtual]
 

Close the saver.

This is not pure virtual. The default implementation does nothing.

There should be a corresponding open, but the signature may vary based on the type of saver, so we can't include it in the interface.

Reimplemented from TAO_Notify::Topology_Saver.

void TAO_Notify::XML_Saver::end_object CORBA::Long  id,
const ACE_CString &type  ACE_ENV_ARG_DECL
[virtual]
 

End the storage of an object.

This function should be called to end the scope of the current object and commit it to the persistent store.

Implements TAO_Notify::Topology_Saver.

char * TAO_Notify::XML_Saver::escape_string char *&  newstr,
size_t &  size,
const ACE_CString str
[private]
 

newstr to allow in-line use

bool TAO_Notify::XML_Saver::open const ACE_CString file_name,
size_t  backup_count
 

Open the output file.

Parameters:
file_name the fully qualified file name
Returns:
true if successful


Member Data Documentation

size_t TAO_Notify::XML_Saver::backup_count_ [private]
 

ACE_CString TAO_Notify::XML_Saver::base_name_ [private]
 

the name of the output file

bool TAO_Notify::XML_Saver::close_out_ [private]
 

ACE_CString TAO_Notify::XML_Saver::indent_ [private]
 

A string consisting of spaces that is our current indentation level.

FILE* TAO_Notify::XML_Saver::output_ [private]
 

A stream representing our current output.

bool TAO_Notify::XML_Saver::timestamp_ [private]
 

true to enable timestamping


The documentation for this class was generated from the following files:
Generated on Sun May 15 13:28:19 2005 for TAO_CosNotification by  doxygen 1.3.9.1