summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-10 05:46:29 +0000
committerkirthika <kirthika@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-10 05:46:29 +0000
commit0b6af9ad1c9df226076ca7e604109ffa438c975f (patch)
tree293b24fc6ed37776538071c6143840790a4aba2c
parent6d7ebe5276c9f697cb7d38b11ae83094f937b7d8 (diff)
downloadATCD-0b6af9ad1c9df226076ca7e604109ffa438c975f.tar.gz
*** empty log message ***
-rw-r--r--TAO/examples/Callback_Quoter/Consumer_Handler.cpp7
-rw-r--r--TAO/examples/Callback_Quoter/Consumer_Input_Handler.cpp11
-rw-r--r--TAO/examples/Callback_Quoter/Consumer_Input_Handler.h60
-rw-r--r--TAO/examples/Callback_Quoter/Consumer_Signal_Handler.h1
-rw-r--r--TAO/examples/Callback_Quoter/Consumer_i.cpp3
-rw-r--r--TAO/examples/Callback_Quoter/Consumer_i.h8
-rw-r--r--TAO/examples/Callback_Quoter/Notifier.idl3
-rw-r--r--TAO/examples/Callback_Quoter/Notifier_i.cpp11
-rw-r--r--TAO/examples/Callback_Quoter/Notifier_i.h8
-rw-r--r--TAO/examples/Callback_Quoter/Supplier_i.cpp5
10 files changed, 61 insertions, 56 deletions
diff --git a/TAO/examples/Callback_Quoter/Consumer_Handler.cpp b/TAO/examples/Callback_Quoter/Consumer_Handler.cpp
index 04b3cafad6b..684ffc8e7cc 100644
--- a/TAO/examples/Callback_Quoter/Consumer_Handler.cpp
+++ b/TAO/examples/Callback_Quoter/Consumer_Handler.cpp
@@ -200,9 +200,6 @@ Consumer_Handler::init (int argc, char **argv)
-1);
// Register the signal event handler for ^C
- // and for the signal which occurs when a terminal window
- // is changed.
-
ACE_NEW_RETURN (consumer_signal_handler_,
Consumer_Signal_Handler (this),
-1);
@@ -307,8 +304,10 @@ Consumer_Handler::run (void)
ACE_Reactor *
Consumer_Handler::reactor_used (void) const
{
- // @@ Please check with Pradeep and see how to remove the reliance
+ //*done* @@ Please check with Pradeep and see how to remove the reliance
// on <TAO_ORB_Core_instance()>. This is non-portable and we want
// to try to use only CORBA-compliant code in our examples.
+
+ // Cant do anything as the reactor is not accessible in any other way.
return TAO_ORB_Core_instance ()->reactor ();
}
diff --git a/TAO/examples/Callback_Quoter/Consumer_Input_Handler.cpp b/TAO/examples/Callback_Quoter/Consumer_Input_Handler.cpp
index 446ddc32197..65427ec8b5d 100644
--- a/TAO/examples/Callback_Quoter/Consumer_Input_Handler.cpp
+++ b/TAO/examples/Callback_Quoter/Consumer_Input_Handler.cpp
@@ -47,19 +47,19 @@ Consumer_Input_Handler::handle_input (ACE_HANDLE)
switch (tolower (buf[0]))
{
- case 'r':
+ case Consumer_Input_Handler::REGISTER:
{
register_consumer ();
TAO_CHECK_ENV;
break;
}
- case 'u':
+ case Consumer_Input_Handler::UNREGISTER:
{
unregister_consumer ();
TAO_CHECK_ENV;
break;
}
- case 'q':
+ case Consumer_Input_Handler::EXIT:
{
quit_consumer_process ();
TAO_CHECK_ENV;
@@ -220,3 +220,8 @@ Consumer_Input_Handler::quit_consumer_process ()
return 0;
}
+
+Consumer_Input_Handler::~Consumer_Input_Handler (void)
+{
+ // No-op
+}
diff --git a/TAO/examples/Callback_Quoter/Consumer_Input_Handler.h b/TAO/examples/Callback_Quoter/Consumer_Input_Handler.h
index dd98dec4d34..3b2d1c62d21 100644
--- a/TAO/examples/Callback_Quoter/Consumer_Input_Handler.h
+++ b/TAO/examples/Callback_Quoter/Consumer_Input_Handler.h
@@ -65,42 +65,38 @@ public:
friend class ACE_Shutup_GPlusPlus;
// Turn off g++ warning
-private:
-
- // @@ Please don't put implementations in the class headers...
- ~Consumer_Input_Handler (void)
- {
- // No-op
- }
+ enum
+ {
+ // = TITLE
+ // A set of values for the execution of the consumer.
+ //
+ // = DESCRIPTION
+ // Used so that the process of registering, unregistering
+ // and exitting neednt be dependent on 'r' 'u' and 'q'.
+ // Also, #define clutters up the global namespace.
+
+ REGISTER = 'r',
+ // The character that the user must type to register the consumer with
+ // the Notifier_server.
+
+ UNREGISTER = 'u',
+ // The character that the user must type to unregister the consumer with
+ // the Notifier_server.
+
+ EXIT = 'q'
+ // The character the user must type to quit the consumer client
+ // application.
+ };
+private:
+ ~Consumer_Input_Handler (void);
+ // the destructor.
+
Consumer_Handler *consumer_handler_;
// The Consumer_Handler object.
+
+
};
-// @@ Please don't use #defines because they clutter up the global
-// namespace. Instead, use enums, e.g.,
-// enum
-// {
-// REGISTER = 'r',
-// UNREGISTER = 'u',
-// EXIT = 'q'
-// };
-//
-// Please put this enum inside of class Consumer_Input_Handler. Note
-// that you'll need to refer to these enumerals as
-// Consumer_Input_Handler::REGISTER, etc. in order to be portable.
-
-#define REGISTER 'r'
-// The character that the user must type to register the consumer with
-// the Notifier_server.
-
-#define UNREGISTER 'u'
-// The character that the user must type to unregister the consumer with
-// the Notifier_server.
-
-#define EXIT 'q'
-// The character the user must type to quit the consumer client
-// application.
-
#endif /* CONSUMER_INPUT_HANDLER_H */
diff --git a/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.h b/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.h
index 8d35f5f89b5..4184c8fba71 100644
--- a/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.h
+++ b/TAO/examples/Callback_Quoter/Consumer_Signal_Handler.h
@@ -29,7 +29,6 @@ class Consumer_Handler;
class Consumer_Signal_Handler : public ACE_Event_Handler
{
- // @@ Please make sure that all the other classes are documented.
// = TITLE
// Creating a class to handle signal events.
//
diff --git a/TAO/examples/Callback_Quoter/Consumer_i.cpp b/TAO/examples/Callback_Quoter/Consumer_i.cpp
index b5b534f1b49..c902d0acd2d 100644
--- a/TAO/examples/Callback_Quoter/Consumer_i.cpp
+++ b/TAO/examples/Callback_Quoter/Consumer_i.cpp
@@ -34,9 +34,6 @@ Consumer_i::push (const Callback_Quoter::Info &data,
// On getting the needed information you now proceed to the next
// step, which could be obtaining the shares.
- // @@ Please see if you can remove this.
- this->done_ = 1;
-
ACE_DEBUG ((LM_DEBUG,
"Selling 10,000 %s shares at %d!!\n",
data.stock_name.in (),
diff --git a/TAO/examples/Callback_Quoter/Consumer_i.h b/TAO/examples/Callback_Quoter/Consumer_i.h
index 727eefe947c..0c1b67b77ae 100644
--- a/TAO/examples/Callback_Quoter/Consumer_i.h
+++ b/TAO/examples/Callback_Quoter/Consumer_i.h
@@ -50,11 +50,9 @@ public:
// Set the ORB pointer.
private:
- // @@ Please see if you can remove this.
- int done_;
- // Denotes whether the information about the stock has been
- // received.
-
+ int quit_;
+ // If 1 denotes that the consumer is dead else alive.
+
CORBA::ORB_var orb_;
// ORB pointer.
diff --git a/TAO/examples/Callback_Quoter/Notifier.idl b/TAO/examples/Callback_Quoter/Notifier.idl
index 9c340c416ef..1c86ed60537 100644
--- a/TAO/examples/Callback_Quoter/Notifier.idl
+++ b/TAO/examples/Callback_Quoter/Notifier.idl
@@ -25,8 +25,7 @@ interface Notifier
// Remove the handler.
void market_status (in string stock_name,
- in long stock_value)
- raises (Callback_Quoter::Invalid_Stock);
+ in long stock_value);
// Get market status.
void shutdown ();
diff --git a/TAO/examples/Callback_Quoter/Notifier_i.cpp b/TAO/examples/Callback_Quoter/Notifier_i.cpp
index 26e22db24af..cfe38715e23 100644
--- a/TAO/examples/Callback_Quoter/Notifier_i.cpp
+++ b/TAO/examples/Callback_Quoter/Notifier_i.cpp
@@ -97,7 +97,7 @@ Notifier_i::register_callback (const char *stock_name,
"register_callback: Bind failed!/n"));
else
ACE_DEBUG ((LM_DEBUG,
- "new map entry: stockname %s threshold %d",
+ "new map entry: stockname %s threshold %d\n",
stock_name,
threshold_value));
@@ -202,11 +202,16 @@ Notifier_i::market_status (const char *stock_name,
}
}
else
+ ACE_DEBUG ((LM_DEBUG,
+ " Stock Not Present!\n"));
+ // Raising an exception caused problems as they were caught by the Market daemon
+ // who exited prematurely.
+
// /*done*/@@ Please add a user defined exception called something like
// NOT_FOUND.
// Exception is raised when the stock doesnt exist in the Hash_map.
- env.exception (new Callback_Quoter::Invalid_Stock (" Nonexistent Stock"));
+ // env.exception (new Callback_Quoter::Invalid_Stock (" Nonexistent Stock"));
// stock_name,
// stock_value);
}
@@ -223,7 +228,7 @@ Notifier_i::shutdown (CORBA::Environment &env)
notifier_exited_ = 1;
ACE_DEBUG ((LM_DEBUG,
- "The Callback Quoter server is shutting down..."));
+ "The Callback Quoter server is shutting down...\n"));
// Instruct the ORB to shutdown.
diff --git a/TAO/examples/Callback_Quoter/Notifier_i.h b/TAO/examples/Callback_Quoter/Notifier_i.h
index f9bd634b4ff..70f84dc9d21 100644
--- a/TAO/examples/Callback_Quoter/Notifier_i.h
+++ b/TAO/examples/Callback_Quoter/Notifier_i.h
@@ -34,8 +34,12 @@
class Notifier_i : public POA_Notifier
{
// = TITLE
- // The implementation of the Notifier class, which is the servant
- // object for the callback quoter server.
+ // Notifier servant class.
+ //
+ // = DESCRIPTION
+ // The implementation of the Notifier class, which is the servant
+ // object for the callback quoter server.
+ //
public:
// = Initialization and termination methods.
Notifier_i (void);
diff --git a/TAO/examples/Callback_Quoter/Supplier_i.cpp b/TAO/examples/Callback_Quoter/Supplier_i.cpp
index 98162d07bf2..9fa3c7c9574 100644
--- a/TAO/examples/Callback_Quoter/Supplier_i.cpp
+++ b/TAO/examples/Callback_Quoter/Supplier_i.cpp
@@ -316,7 +316,10 @@ Supplier::reactor_used (void) const
int
Supplier::read_file (char *filename)
{
- f_ptr_ = ACE_OS::fopen ("stocks.st", "rw");
+ f_ptr_ = ACE_OS::fopen (filename, "r");
+
+ ACE_DEBUG ((LM_DEBUG,
+ "filename = %s\n",filename));
// the stock values are to be read from a file.
if (f_ptr_ == 0)