2 //=============================================================================
6 * This class implements a simple CORBA server that keeps
7 * on sending stock values to the Notifier.
9 * @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
11 //=============================================================================
16 #include "orbsvcs/Naming/Naming_Client.h"
17 #include "orbsvcs/CosNamingC.h"
18 #include "ace/Reactor.h"
19 #include "ace/Read_Buffer.h"
20 #include "NotifierC.h"
21 #include "Supplier_Timer_Handler.h"
23 #if !defined (ACE_LACKS_PRAGMA_ONCE)
25 #endif /* ACE_LACKS_PRAGMA_ONCE */
30 * @brief Market feed daemon implementation.
32 * This class feeds stock information to the Callback Quoter
35 class Supplier_Timer_Handler
;
45 /// Execute the daemon.
48 /// Initialize the client communication endpoint with Notifier.
49 int init (int argc
, ACE_TCHAR
*argv
[]);
51 /// Sends the stock name and its value.
52 int send_market_status (const char *stock_name
,
56 /// The timer handler used to send the market status to the notifier
58 Supplier_Timer_Handler
*supplier_timer_handler_
{};
63 /// Function to read the Notifier IOR from a file.
64 int read_ior (ACE_TCHAR
*filename
);
66 /// Parses the arguments passed on the command line.
69 /// This method initialises the naming service and registers the
70 /// object with the POA.
71 int via_naming_service();
73 /// returns the TAO instance of the singleton Reactor.
74 ACE_Reactor
*reactor_used () const;
76 /// This method used for getting stock information from a file.
77 int read_file (ACE_TCHAR
*filename
);
79 /// # of arguments on the command line.
82 /// arguments from command line.
85 /// IOR of the obj ref of the Notifier.
88 /// An instance of the name client used for resolving the factory
90 TAO_Naming_Client naming_services_client_
;
92 /// This variable denotes whether the naming service
94 int use_naming_service_
;
96 /// Notifier object reference.
97 Notifier_var notifier_
;
99 /// The pointer for accessing the input stream.
105 /// Time period between two succesive market feeds to the Notifier.
109 #endif /*SUPPLIER_I_H */