#include <Offer_Database.h>
Collaboration diagram for TAO_Offer_Database< LOCK_TYPE >:
Public Types | |
typedef TAO_Service_Offer_Iterator< LOCK_TYPE > | offer_iterator |
typedef ACE_Hash_Map_Manager_Ex< CORBA::String_var, Offer_Map_Entry *, ACE_Hash< CORBA::String_var >, ACE_Equal_To< CORBA::String_var >, ACE_Null_Mutex > | Offer_Database |
Public Member Functions | |
TAO_Offer_Database (void) | |
No arg constructor. | |
~TAO_Offer_Database (void) | |
CosTrading::OfferId | insert_offer (const char *type, CosTrading::Offer *offer) |
int | remove_offer (const CosTrading::OfferId offer_id) throw (CosTrading::IllegalOfferId, CosTrading::UnknownOfferId) |
CosTrading::Offer * | lookup_offer (const CosTrading::OfferId offer_id) throw (CosTrading::IllegalOfferId, CosTrading::UnknownOfferId) |
CosTrading::Offer * | lookup_offer (const CosTrading::OfferId offer_id, char *&type_name) throw (CosTrading::IllegalOfferId, CosTrading::UnknownOfferId) |
TAO_Offer_Id_Iterator * | retrieve_all_offer_ids (void) |
Private Member Functions | |
CosTrading::Offer * | lookup_offer (const char *type, CORBA::ULong id) |
int | remove_offer (const char *type, CORBA::ULong id) |
void | operator= (const TAO_Offer_Database< LOCK_TYPE > &) |
TAO_Offer_Database (const TAO_Offer_Database< LOCK_TYPE > &) | |
Static Private Member Functions | |
static CosTrading::OfferId | generate_offer_id (const char *type_name, CORBA::ULong id) |
static void | parse_offer_id (const CosTrading::OfferId offer_id, char *&service_type, CORBA::ULong &id) throw (CosTrading::IllegalOfferId) |
Private Attributes | |
LOCK_TYPE | db_lock_ |
Offer_Database | offer_db_ |
Friends | |
class | TAO_Service_Offer_Iterator< LOCK_TYPE > |
Classes | |
struct | Offer_Map_Entry |
typedef ACE_Hash_Map_Manager_Ex< CORBA::String_var, Offer_Map_Entry*, ACE_Hash<CORBA::String_var>, ACE_Equal_To<CORBA::String_var>, ACE_Null_Mutex > TAO_Offer_Database< LOCK_TYPE >::Offer_Database |
typedef TAO_Service_Offer_Iterator<LOCK_TYPE> TAO_Offer_Database< LOCK_TYPE >::offer_iterator |
TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO_Offer_Database< LOCK_TYPE >::TAO_Offer_Database | ( | void | ) |
No arg constructor.
TAO_Offer_Database< LOCK_TYPE >::~TAO_Offer_Database | ( | void | ) |
TAO_Offer_Database< LOCK_TYPE >::TAO_Offer_Database | ( | const TAO_Offer_Database< LOCK_TYPE > & | ) | [private] |
CosTrading::OfferId TAO_Offer_Database< LOCK_TYPE >::generate_offer_id | ( | const char * | type_name, | |
CORBA::ULong | id | |||
) | [static, private] |
Take in a service type name for the offer the current value of of the counter and generate an offer id.
CosTrading::OfferId TAO_Offer_Database< LOCK_TYPE >::insert_offer | ( | const char * | type, | |
CosTrading::Offer * | offer | |||
) |
Add an offer of type <type> and generate a CosTrading::OfferId for it. Returns 0 on failure.
CosTrading::Offer * TAO_Offer_Database< LOCK_TYPE >::lookup_offer | ( | const char * | type, | |
CORBA::ULong | id | |||
) | [private] |
Lookup an offer whose type is <type> and id, <id>. Return 0 on failure.
CosTrading::Offer * TAO_Offer_Database< LOCK_TYPE >::lookup_offer | ( | const CosTrading::OfferId | offer_id, | |
char *& | type_name | |||
) | throw (CosTrading::IllegalOfferId, CosTrading::UnknownOfferId) |
Lookup an offer whose OfferId is <offer_id> and return in <type_name> the type name of the object. Type name is just a pointer to a location in offer_id, so DON'T DELETE IT.
CosTrading::Offer * TAO_Offer_Database< LOCK_TYPE >::lookup_offer | ( | const CosTrading::OfferId | offer_id | ) | throw (CosTrading::IllegalOfferId, CosTrading::UnknownOfferId) |
Lookup an offer whose offer_id is <offer_id>, and return it. Otherwise, throw the appropriate exception.
void TAO_Offer_Database< LOCK_TYPE >::operator= | ( | const TAO_Offer_Database< LOCK_TYPE > & | ) | [private] |
void TAO_Offer_Database< LOCK_TYPE >::parse_offer_id | ( | const CosTrading::OfferId | offer_id, | |
char *& | service_type, | |||
CORBA::ULong & | id | |||
) | throw (CosTrading::IllegalOfferId) [static, private] |
Take in a previously generated offer id and return the type and id that were used to generate the offer id.
int TAO_Offer_Database< LOCK_TYPE >::remove_offer | ( | const char * | type, | |
CORBA::ULong | id | |||
) | [private] |
Remove an offers whose id is <offer_id>. Returns 0 on success, -1 on failure, and throws a CosTrading::IllegalOfferId if it can't parse the CosTrading::OfferId.
int TAO_Offer_Database< LOCK_TYPE >::remove_offer | ( | const CosTrading::OfferId | offer_id | ) | throw (CosTrading::IllegalOfferId, CosTrading::UnknownOfferId) |
TAO_Offer_Id_Iterator * TAO_Offer_Database< LOCK_TYPE >::retrieve_all_offer_ids | ( | void | ) |
Return an iterator that will traverse and return all the offer ids in the service type map.
friend class TAO_Service_Offer_Iterator< LOCK_TYPE > [friend] |
LOCK_TYPE TAO_Offer_Database< LOCK_TYPE >::db_lock_ [private] |
Offer_Database TAO_Offer_Database< LOCK_TYPE >::offer_db_ [private] |