PSDL_Code_Gen.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: PSDL_Code_Gen.h 77020 2007-02-12 13:56:49Z johnnyw $
00003 //
00004 // ==================================================================
00005 //
00006 // = LIBRARY
00007 //    PSS
00008 //
00009 // = FILENAME
00010 //    PSDL_Code_Gen
00011 //
00012 // = DESCRIPTION
00013 //    This class acts as an interface to the database which is used
00014 //    for the saving the state of the objects. Right now, the database
00015 //    is a normal file.
00016 //
00017 // = AUTHOR
00018 //    Priyanka Gontla <gontla_p@ociweb.com>
00019 //
00020 // ==================================================================
00021 
00022 #ifndef TAO_PSDL_CODE_GEN_H
00023 #define TAO_PSDL_CODE_GEN_H
00024 
00025 #include /**/ "ace/pre.h"
00026 
00027 #include "psdl_export.h"
00028 
00029 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00030 # pragma once
00031 #endif /* ACE_LACKS_PRAGMA_ONCE */
00032 
00033 #include "tao/IOPC.h"
00034 #include "tao/ORB.h"
00035 
00036 class TAO_PSDL_Datastore;
00037 
00038 class TAO_PSDL_Export TAO_PSDL_Code_Gen
00039 {
00040  public:
00041 
00042   TAO_PSDL_Code_Gen (CORBA::ORB_ptr orb);
00043 
00044   ~TAO_PSDL_Code_Gen (void);
00045 
00046   /// Initializes a IOP::CodecFactory and IOP::Codec to take care of
00047   /// the marshalling and demarshalling of data.
00048   int set_codec (void);
00049 
00050   /// Method to save the name-stringified object reference pair
00051   /// to the database. Returns -1 on failure.
00052   int set_name_obj_ref (const char *name,
00053                         const char *string_obj_ref);
00054 
00055   /// Get the stringified form of the object reference given the name
00056   /// of the object.
00057   const char *get_obj_ref (const char *name);
00058 
00059  private:
00060 
00061   /// Helper method which serializes the data and saves it to the
00062   /// database.
00063   CORBA::OctetSeq *encode (const char *string_obj_ref);
00064 
00065 
00066   /// Helper method to get the octet sequence
00067   const char *decode (const CORBA::OctetSeq &data);
00068 
00069   /// File where the persistent data is stored.
00070   const char *file_name_;
00071 
00072   /// Pointer to the class which accesses the database
00073   TAO_PSDL_Datastore *psdl_datastore_;
00074 
00075   /// Pointer to ORB
00076   CORBA::ORB_var orb_;
00077 
00078   /// CDR encapsulation codec useful for encoding and decoding the
00079   /// data
00080   IOP::Codec_var codec_;
00081 };
00082 
00083 #include /**/ "ace/post.h"
00084 
00085 #endif /* TAO_PSDL_CODE_GEN_H */

Generated on Tue Feb 2 17:50:13 2010 for TAO_PSS by  doxygen 1.4.7