Changes to attempt to silence bcc64x
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_App / FT_TestReplica_i.h
blobef6bfbb12f69eb70ba4513310eb6d4de61ad8c5e
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file FT_TestReplica_i.h
6 * This file declares an implementation of CORBA interface TestReplica.
8 * @author Dale Wilson <wilson_d@ociweb.com>
9 */
10 //=============================================================================
12 #ifndef FT_TESTREPLICA_I_H_
13 #define FT_TESTREPLICA_I_H_
14 #include /**/ "ace/pre.h"
16 #include <ace/ACE.h>
17 #if !defined (ACE_LACKS_PRAGMA_ONCE)
18 # pragma once
19 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 #include "ace/SString.h"
23 #include "FT_TestReplicaS.h"
25 ////////////////////
26 // Forward Reference
27 class FT_ReplicaFactory_i;
29 /**
30 * Implement the TestReplica IDL interface.
32 * Persistent storage simulated by storing the counter
33 * in Persistent.dat.
35 class FT_TestReplica_i : public virtual POA_FT_TEST::TestReplica
37 public:
38 FT_TestReplica_i (FT_ReplicaFactory_i * factory, const char * name, unsigned long factory_id);
39 virtual ~FT_TestReplica_i ();
41 /**
42 * parse command line arguments.
43 * remove any that are recognized, adjusting argc accordingly.
44 * @param argc classic C argc
45 * @param argv classic C argv
46 * @return 0 if ok, otherwise process exit code.
48 int parse_args (int argc, ACE_TCHAR *argv[]);
50 /**
51 * provide information to appear in a "usage" display.
52 * caller will display:
53 * usage: [program] &lt;usageMessage()&gt; [other usage]
54 * @returns c-style string containing "bare" usage options.
56 const char * usage_options();
58 /**
59 * Initialize this object.
60 * @param orbManager our ORB -- we keep var to it.
61 * @return zero for success; nonzero is process return code for failure.
63 int init (CORBA::ORB_var & orb, const ACE_TCHAR*);
65 /**
66 * Prepare to exit.
67 * @return zero for success; nonzero is process return code for failure.
69 int fini ();
71 /**
72 * idle time activity.
73 * @param result [out] status code to return from process
74 * @returns 0 to continue; nonzero to quit
76 int idle(int &result);
78 void request_quit();
80 unsigned long factory_id()const;
82 static const char * repository_id();
84 ::FT_TEST::TestReplica_ptr object_reference();
86 PortableServer::ObjectId object_id()const;
88 //////////////////////////////////////////
89 // Override CORBA servant virtual methods
90 virtual PortableServer::POA_ptr _default_POA ();
92 virtual void _remove_ref ();
94 private:
95 ///////////////////////////
96 // override Replica methods
97 virtual void set (CORBA::Long value);
99 virtual CORBA::Long increment (CORBA::Long delta);
101 virtual CORBA::Long get ();
103 virtual CORBA::Long counter ();
105 virtual void counter (CORBA::Long counter);
107 virtual void die (FT_TEST::TestReplica::Bane when);
109 virtual void shutdown ();
111 ///////////////////////////
112 // override PullMonitorable
114 virtual CORBA::Boolean is_alive ();
116 ///////////////////////////
117 // override Updatable
119 virtual ::FT::State * get_update ();
121 virtual void set_update (const FT::State & s);
123 virtual ::FT::State * get_state ();
125 virtual void set_state (const FT::State & s);
127 ////////////////
128 // Implement TAO_UpdateObjectGroup
130 virtual void tao_update_object_group (
131 const char * iogr,
132 PortableGroup::ObjectGroupRefVersion version,
133 CORBA::Boolean is_primary);
135 /////////////////
136 // implementation
137 private:
139 * Load the persistent data.
140 * returns the data loaded.
142 long load();
144 * Store the persistent data.
145 * @param value the data to be stored.
147 void store(long value);
149 void suicide(const char *);
151 ///////////////
152 // data members
153 private:
155 * a bane code for when we should die.
157 FT_TEST::TestReplica::Bane death_pending_;
160 * verbosity level, settable by client.
162 int verbose_;
165 * who am I?
167 ACE_CString name_;
170 * The ID number assigned by the factory
172 unsigned long factory_id_;
175 * The factory that created this replica
177 FT_ReplicaFactory_i * factory_;
180 * The orb
182 CORBA::ORB_var orb_;
185 * The POA used to activate this object.
187 PortableServer::POA_var poa_;
190 * The CORBA object id assigned to this object.
192 PortableServer::ObjectId_var object_id_;
195 * The CORBA object id assigned to this object.
198 const ACE_TCHAR* name_persistent_storage;
201 #include /**/ "ace/post.h"
203 #endif /* FT_TESTREPLICA_I_H_ */