iopc::MetadataInitializer Class Reference
[iopcmeta]

Allows users to initialize class metadata at the library startup. More...

#include <metadataInitializer.h>

Inheritance diagram for iopc::MetadataInitializer:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void initializeMetadata ()=0
 Implementations should set the class metadata or global settings here.


Detailed Description

Allows users to initialize class metadata at the library startup.

Class metadata can be initialized in two standard ways: either by implementing the static void iopcInit(iopc::Type& t) or by passing an instance of a MetadataInitializer implementation to IopcMeta::init(MetadataInitializer* metadataInitializer) Only these two ways guarantee that the class metadata will be set properly and that they will have desired effect on the program execution.

Example:

 class OurMetadataInitializer : public MetadataInitializer {
 public:
 virtual void initializeMetadata() {
   globalSettings["db.oracle.oidSequence.name"].setStringValue("OIDS");
   TypeDesc<MyType>::getType()["db.table"].setStringValue("MYTABLE");
   ...
 };

 ...

 int main(int argc, char *argv[])
 {
   Iopc::init(new OurMetadataInitializer(), LogWriter::ERROR ... );
   ...
 }

Member Function Documentation

virtual void iopc::MetadataInitializer::initializeMetadata (  )  [pure virtual]

Implementations should set the class metadata or global settings here.

Typical implementation would load metadata from a configuration file and use TypeManager and related classes to set them on matching classes and attributes.

Implemented in iopc::TextFileMetadataLoader.


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

Generated on Tue Apr 14 16:46:37 2009 for IOPC 2 by  doxygen 1.5.6