Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tests / ORB_Local_Config / Two_DLL_ORB / ORB_DLL.h
blobd7d387706027390eaee690ba4b6977c25f971d1e
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file ORB_DLL.h
7 * @author Iliyan Jeliazkov <iliyan@ociweb.com>
8 */
9 //=============================================================================
11 #ifndef SERVICE_CONFIG_ORB_DLL_H
12 #define SERVICE_CONFIG_ORB_DLL_H
14 #include /**/ "ace/pre.h"
16 #include "ORB_DLL_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include <memory>
23 #include "ace/Task.h"
24 #include "ace/ARGV.h"
25 #include "ace/String_Base.h"
26 #include "tao/ORB.h"
28 ///
29 class Abstract_Worker
31 public:
32 Abstract_Worker (const ACE_TCHAR *ior);
33 virtual ~Abstract_Worker ();
34 virtual int test_main (int argc,
35 ACE_TCHAR *argv[]) = 0;
36 virtual const ACE_TCHAR * kind () const = 0;
37 protected:
38 ACE_TString ior_file_;
41 /**
42 * A server kind of test
44 class Server_Worker : public Abstract_Worker
46 public:
47 Server_Worker ();
48 ~Server_Worker ();
49 int test_main (int argc, ACE_TCHAR *argv[]);
50 const ACE_TCHAR * kind () const;
52 private:
53 int parse_args (int argc, ACE_TCHAR *argv[]);
56 /**
57 * A client kind of test
59 class Client_Worker : public Abstract_Worker
61 public:
62 Client_Worker ();
63 ~Client_Worker ();
64 int test_main (int argc, ACE_TCHAR *argv[]);
65 const ACE_TCHAR * kind () const;
67 private:
68 int parse_args (int argc, ACE_TCHAR *argv[]);
71 /**
72 * @class Service_Config_ORB_DLL
74 * @brief The Service_Config_ORB_DLL that is instantiated when the
75 * client-side test module/library is dynamically loaded.
77 class Service_Config_ORB_DLL_Export Service_Config_ORB_DLL
78 : public ACE_Task_Base
80 public:
81 /// Constructor.
82 Service_Config_ORB_DLL ();
83 ~Service_Config_ORB_DLL ();
85 /// Initializes object when dynamic linking occurs.
86 virtual int init (int argc, ACE_TCHAR *argv[]);
88 /// Run by a daemon thread.
89 /**
90 * Each thread will invoke the Service Configurator via this
91 * method unless the object is the "FINAL" object.
93 virtual int svc ();
95 private:
96 signed char is_server_;
97 std::unique_ptr<Abstract_Worker> worker_;
98 std::unique_ptr<ACE_ARGV> argv_;
101 ACE_FACTORY_DECLARE (Service_Config_ORB_DLL, Service_Config_ORB_DLL)
103 #include /**/ "ace/post.h"
105 #endif /* SERVICE_CONFIG_ORB_DLL_H */