TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > Class Template Reference

This class packages together all the various pieces that provide functionality specified in COS Trading specification. More...

#include <Trader_T.h>

Inheritance diagram for TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >:

Inheritance graph
[legend]
Collaboration diagram for TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef TAO_Offer_Database<
MAP_LOCK_TYPE > 
Offer_Database
 Offer Database Trait.

Public Member Functions

 TAO_Trader (Trader_Components components=LOOKUP)
virtual ~TAO_Trader (void)
 Destructor.
Offer_Databaseoffer_database (void)
 Accessor for the structure with all the service offers.
ACE_Locklock (void)
 Returns the trader.

Protected Types

typedef TAO_Trader< TRADER_LOCK_TYPE,
MAP_LOCK_TYPE > 
TRADER_SELF
 LOOKUP_IF
 REGISTER_IF
 ADMIN_IF
 PROXY_IF
 LINK_IF
enum  {
  LOOKUP_IF, REGISTER_IF, ADMIN_IF, PROXY_IF,
  LINK_IF
}

Protected Attributes

Offer_Database offer_database_
ACE_Lock_Adapter< TRADER_LOCK_TYPE > lock_
 Lock that guards the state of the trader (its configuration).
PortableServer::ServantBaseifs_ [5]

Private Member Functions

void operator= (const TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > &)

Detailed Description

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
class TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >

This class packages together all the various pieces that provide functionality specified in COS Trading specification.

TAO_Trader contains all the components that together represent a single trader. Based on its constructor arguments, TAO_Trader creates instances of appropriate interface implementations as well as instances of objects common to more than one interface (offers, attributes, etc.). TAO_Trader also enforces the proper order on all initializations. TAO_Trader acts like a "glue" class that creates appropriate components, holds everything together, and enforces order. TAO_Trader is parameterized by two types of locks: one for its service service offers, one for its state (configuration).

Definition at line 57 of file Trader_T.h.


Member Typedef Documentation

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
typedef TAO_Offer_Database<MAP_LOCK_TYPE> TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::Offer_Database

Offer Database Trait.

Definition at line 65 of file Trader_T.h.

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
typedef TAO_Trader<TRADER_LOCK_TYPE, MAP_LOCK_TYPE> TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::TRADER_SELF [protected]

Definition at line 86 of file Trader_T.h.


Member Enumeration Documentation

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
anonymous enum [protected]

Enumerator:
LOOKUP_IF 
REGISTER_IF 
ADMIN_IF 
PROXY_IF 
LINK_IF 

Definition at line 93 of file Trader_T.h.


Constructor & Destructor Documentation

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::TAO_Trader ( Trader_Components  components = LOOKUP  ) 

Constructor which based on its arguments will create a particular type of trader (e.g. Query trader, Simple trader, etc.) The argument is a bitwise OR of desired Trader_Components as listed in enumerated type above.

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::~TAO_Trader ( void   )  [virtual]

Destructor.

Definition at line 84 of file Trader_T.cpp.

References TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::LINK_IF, and TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::LOOKUP_IF.

00085 {
00086   // Remove Trading Components from POA
00087 
00088 
00089   for (int i = LOOKUP_IF; i <= LINK_IF; i++)
00090     {
00091       if (this->ifs_[i] != 0)
00092         {
00093           try
00094             {
00095               PortableServer::POA_var poa =
00096                 this->ifs_[i]->_default_POA ();
00097 
00098               PortableServer::ObjectId_var id =
00099                 poa->servant_to_id (this->ifs_[i]);
00100 
00101               poa->deactivate_object (id.in ());
00102             }
00103           catch (const CORBA::Exception&)
00104             {
00105               // Don't let exceptions propagate out of this call since
00106               // it's the destructor!
00107             }
00108         }
00109     }
00110 }


Member Function Documentation

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
ACE_Lock & TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::lock ( void   )  [virtual]

Returns the trader.

Implements TAO_Lockable.

Definition at line 120 of file Trader_T.cpp.

References TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::lock_.

00121 {
00122   return this->lock_;
00123 }

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
TAO_Offer_Database< MAP_LOCK_TYPE > & TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::offer_database ( void   ) 

Accessor for the structure with all the service offers.

Definition at line 114 of file Trader_T.cpp.

References TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::offer_database_.

00115 {
00116   return this->offer_database_;
00117 }

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
void TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::operator= ( const TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE > &   )  [private]


Member Data Documentation

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
PortableServer::ServantBase* TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::ifs_[5] [protected]

Definition at line 95 of file Trader_T.h.

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
ACE_Lock_Adapter<TRADER_LOCK_TYPE> TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::lock_ [protected]

Lock that guards the state of the trader (its configuration).

Definition at line 91 of file Trader_T.h.

Referenced by TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::lock().

template<class TRADER_LOCK_TYPE, class MAP_LOCK_TYPE>
Offer_Database TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::offer_database_ [protected]

Definition at line 88 of file Trader_T.h.

Referenced by TAO_Trader< TRADER_LOCK_TYPE, MAP_LOCK_TYPE >::offer_database().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:49:35 2010 for TAO_CosTrader by  doxygen 1.4.7