ObjectIndex.h
См. документацию.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00022
00023 #ifndef ObjcetIndex_H_
00024 #define ObjcetIndex_H_
00025
00026 #include <ostream>
00027 #include <string>
00028 #include "UniSetTypes.h"
00029
00030 namespace UniSetTypes
00031 {
00032 class ObjectIndex
00033 {
00034 public:
00035 ObjectIndex(){};
00036 virtual ~ObjectIndex(){};
00037
00038 static const std::string sepName;
00039 static const std::string sepNode;
00040
00041
00042 virtual const ObjectInfo* getObjectInfo( const ObjectId )=0;
00043 virtual const ObjectInfo* getObjectInfo( const std::string name )=0;
00044
00045
00046 static std::string mkRepName( const std::string repname, const std::string nodename );
00047
00048 static std::string mkFullNodeName( const std::string realnode, const std::string virtnode );
00049
00050 static std::string getBaseName( const std::string fname );
00051
00052
00053 virtual ObjectId getIdByName(const std::string& name)=0;
00054 virtual std::string getNameById( const ObjectId id );
00055 virtual std::string getNameById( const ObjectId id, const ObjectId node );
00056
00057
00058 virtual std::string getFullNodeName(const std::string& fullname);
00059 virtual std::string getVirtualNodeName(const std::string& fullNodeName);
00060 virtual std::string getRealNodeName(const std::string& fullNodeName);
00061 virtual std::string getRealNodeName( const ObjectId id );
00062
00063 virtual std::string getName( const std::string& fullname );
00064
00065
00066 virtual std::string getMapName(const ObjectId id)=0;
00067 virtual std::string getTextName(const ObjectId id)=0;
00068
00069
00070 virtual std::ostream& printMap(std::ostream& os)=0;
00071
00072
00073 inline ObjectId getIdByFullName(const std::string& fname)
00074 {
00075 return getIdByName(getName(fname));
00076 }
00077
00078 inline ObjectId getNodeId( const std::string& fullname )
00079 {
00080 return getIdByName( getFullNodeName(fullname) );
00081 }
00082
00083 inline std::string getFullNodeName( const ObjectId nodeid )
00084 {
00085 return getMapName(nodeid);
00086 }
00087
00088 void initLocalNode( ObjectId nodeid );
00089
00090
00091 protected:
00092 std::string nmLocalNode;
00093
00094 private:
00095
00096 };
00097
00098
00099
00100 }
00101
00102 #endif