// //////////////////////////////////////////////////////// // Lecture on the CORBA Component Model, summer term 2003 // Assignment 6, Stephan Brumme, 702544 // // CORBA CCM HomeFinder (Implementation) // #ifndef __HOMEFINDERIMPL_H__ #define __HOMEFINDERIMPL_H__ // generated by the IDL compiler #pragma warning (disable: 4267) #include "ccm.h" // use some stuff from STL #include #include using namespace std; // just for convenience using namespace Components; class HomeFinder_Impl : public virtual POA_HPI::HomeFinder { public: // ctor HomeFinder_Impl(CORBA::ORB_var theOrb) : orb(theOrb) {} // HomeFinder's interface CCMHome_ptr find_home_by_component_type( const char* comp_repid ); CCMHome_ptr find_home_by_home_type( const char* home_repid ); CCMHome_ptr find_home_by_name( const char* home_name ); // additional interface requested by Mr. von Loewis CORBA::Long _cxx_register( const char* comp_repid, const char* home_repid, CCMHome_ptr the_home ); void unregister( CORBA::Long cookie ); private: // the ORB's reference CORBA::ORB_var orb; // a very basic unique ID generator static CORBA::Long uniqueId; // a single entry of the directory struct Entry { string compRepId; string homeRepId; string homeName; CORBA::Long uniqueId; }; // a collection holding the directory typedef list directoryCollection; // an iterator (for the directory) typedef directoryCollection::iterator directoryIterator; // the directory itself directoryCollection directory; }; #endif // __HOMEFINDERIMPL_H__