Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / CSD_Framework / CSD_Strategy_Repository.h
blobed993fb8c17da181dedd83fbba87aafccdee0bb0
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file CSD_Strategy_Repository.h
7 * @author Yan Dai <dai_y@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef TAO_CSD_STRATEGY_FACTORY_H
12 #define TAO_CSD_STRATEGY_FACTORY_H
14 #include /**/ "ace/pre.h"
16 #include "tao/CSD_Framework/CSD_FW_Export.h"
17 #include "tao/CSD_Framework/CSD_FrameworkC.h"
18 #include "ace/Service_Object.h"
19 #include "ace/Service_Config.h"
20 #include "ace/Synch.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
28 /**
29 * @class TAO_CSD_Strategy_Factory
31 * @brief An ACE_Service_Object capable of creating TP_Strategy objects.
33 * TBD - Explain in more detail.
36 class TAO_CSD_FW_Export TAO_CSD_Strategy_Repository : public ACE_Service_Object
38 public:
39 /// Constructor.
40 TAO_CSD_Strategy_Repository();
42 /// Virtual Destructor.
43 virtual ~TAO_CSD_Strategy_Repository();
45 int init (int argc, ACE_TCHAR ** argv);
47 /// Factory method used to create a CSD_Strategy object.
48 CSD_Framework::Strategy_ptr find (const ACE_CString& poa_name);
50 int add_strategy (const ACE_CString& poa_name,
51 CSD_Framework::Strategy_ptr strategy);
53 private:
54 struct Strategy_Node {
55 Strategy_Node(const ACE_CString& poa_name,
56 CSD_Framework::Strategy_ptr strategy);
57 ~Strategy_Node();
58 void add_node (Strategy_Node *);
59 Strategy_Node *find(const ACE_CString& name);
61 ACE_CString poa_name_;
62 CSD_Framework::Strategy_var strategy_;
63 Strategy_Node * next_;
65 Strategy_Node * strategy_list_head_;
69 ACE_STATIC_SVC_DECLARE_EXPORT (TAO_CSD_FW, TAO_CSD_Strategy_Repository)
70 ACE_FACTORY_DECLARE (TAO_CSD_FW, TAO_CSD_Strategy_Repository)
72 TAO_END_VERSIONED_NAMESPACE_DECL
74 #include /**/ "ace/post.h"
76 #endif /* TAO_CSD_STRATEGY_FACTORY_H */