00001 #ifndef BROKER_H
00002 #define BROKER_H
00003
00004 #include "BON.h"
00005 #include "BONImpl.h"
00006 #include "Common.h"
00007 #include "list"
00008 #include "string"
00009
00010
00011 class Broker
00012 {
00013 public:
00014 static const int INVALID_METAREF;
00015 static const int INITIAL_METAREF;
00016 static const std::string ROOTFOLDER_METAREF_STR;
00017
00018 class MetaRefNode {
00019 public:
00020 MetaRefNode( BON::Object o = BON::Object(), BON::Folder f = BON::Folder(), const std::string &p = std::string(""), int m = INVALID_METAREF) : obj(o), folder(f), path(p), metaref(m) {};
00021 BON::Object obj;
00022 BON::Folder folder;
00023 std::string path;
00024 int metaref;
00025 };
00026
00027 static void reset();
00028 static void init();
00029 static int getNextConstraintId();
00030 static int getNextMetaRefId();
00031
00032 static std::string getRegistryTokenName( const BON::Object& obj);
00033 static void initFromObj( BON::Object& obj, BON::Folder& folder, const std::string& kind);
00034 static void initFromAspectObj( BON::Object& obj, const std::string& name, BON::Folder& folder);
00035 static void initFromRegistry( BON::Object& obj, BON::Folder& folder, const BON::RegistryNode& regNode);
00036
00037 static void checkDuplicates();
00038
00039
00040 private:
00041 typedef std::list<MetaRefNode> MetaRefDB;
00042 typedef std::list<MetaRefNode>::iterator MetaRefDB_Iterator;
00043 static MetaRefDB m_metaRefDB;
00044 static int m_firstFree;
00045
00046 static int m_constraintId;
00047 static int m_metaRefId;
00048 };
00049
00050 #endif