ObjectRepository.h
См. документацию.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00024
00025 #ifndef ObjectRepository_H_
00026 #define ObjectRepository_H_
00027
00028 #include <omniORB4/CORBA.h>
00029 #include <omniORB4/Naming.hh>
00030 #include <string>
00031 #include "UniSetTypes.h"
00032 #include "Exceptions.h"
00033 #include "Configuration.h"
00034
00035
00036
00037
00045 class ObjectRepository
00046 {
00047 public:
00048
00049 ObjectRepository(UniSetTypes::Configuration* conf);
00050 ~ObjectRepository();
00051
00055
00056 void registration(const std::string& name, const UniSetTypes::ObjectPtr oRef, const std::string& section, bool force=false)
00057 throw(UniSetTypes::ORepFailed, UniSetTypes::ObjectNameAlready, UniSetTypes::InvalidObjectName, UniSetTypes::NameNotFound);
00058
00060 void registration(const std::string& fullName, const UniSetTypes::ObjectPtr oRef, bool force=false)
00061 throw(UniSetTypes::ORepFailed, UniSetTypes::ObjectNameAlready,UniSetTypes::InvalidObjectName, UniSetTypes::NameNotFound);
00062
00064 void unregistration(const std::string& name, const std::string& section)throw(UniSetTypes::ORepFailed, UniSetTypes::NameNotFound);
00066 void unregistration(const std::string& fullName)throw(UniSetTypes::ORepFailed, UniSetTypes::NameNotFound);
00067
00068
00069
00071 UniSetTypes::ObjectPtr resolve(const std::string& name, const std::string NSName="NameService")throw(UniSetTypes::ORepFailed, UniSetTypes::NameNotFound);
00072
00073
00074
00075
00077 bool isExist( UniSetTypes::ObjectPtr oref );
00079 bool isExist( const std::string& fullName );
00080
00081
00088 enum ObjectType{
00089 ObjectRef,
00090 Section
00091 };
00092
00094 bool list(const std::string& section, UniSetTypes::ListObjectName *ls, unsigned int how_many=300)throw(UniSetTypes::ORepFailed);
00095
00097 bool listSections(const std::string& in_section, UniSetTypes::ListObjectName *ls, unsigned int how_many=300)throw(UniSetTypes::ORepFailed);
00098
00099
00100
00101
00102
00103 protected:
00104
00105 ObjectRepository();
00106 std::string nsName;
00107 UniSetTypes::Configuration* uconf;
00108
00109 bool list(const std::string& section, UniSetTypes::ListObjectName *ls, unsigned int how_many, ObjectType type);
00110
00111 private:
00112 bool init();
00113 CosNaming::NamingContext_var localctx;
00114 };
00115
00116
00117
00118 #endif
00119