summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormxiong <mxiong@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-05-27 01:31:52 +0000
committermxiong <mxiong@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2005-05-27 01:31:52 +0000
commit3ffe90c9ce3702447428ad8e87969ca81963dc0c (patch)
treee32e8001ffe999b98e823e397eac0dad27c6a8f0
parent28f64b09a15e6911a7f8377ec2a1b1606d5b4f74 (diff)
downloadATCD-3ffe90c9ce3702447428ad8e87969ca81963dc0c.tar.gz
*** empty log message ***
-rw-r--r--TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker.cpp16
-rw-r--r--TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.cpp12
-rw-r--r--TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.h4
-rw-r--r--TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor.cpp72
-rw-r--r--TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.cpp13
-rw-r--r--TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.h43
6 files changed, 85 insertions, 75 deletions
diff --git a/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker.cpp b/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker.cpp
index 50537b545c4..330b4419477 100644
--- a/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker.cpp
+++ b/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker.cpp
@@ -25,16 +25,16 @@ parse_args (int argc, char *argv[])
switch (c)
{
case 'k':
- broker_ior = get_opts.opt_arg ();
- break;
+ broker_ior = get_opts.opt_arg ();
+ break;
case 's':
- subscribe_name = get_opts.opt_arg ();
- break;
+ subscribe_name = get_opts.opt_arg ();
+ break;
case 'u':
- unsubscribe_name = get_opts.opt_arg ();
- break;
+ unsubscribe_name = get_opts.opt_arg ();
+ break;
case '?':
default:
@@ -74,8 +74,8 @@ int main (int argc, char* argv[])
// downcast the object reference to the appropriate type
Stock::StockBroker_var broker =
- Stock::StockBroker::_narrow (broker_obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ Stock::StockBroker::_narrow (broker_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
if (CORBA::is_nil (broker.in ()))
diff --git a/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.cpp b/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.cpp
index 3120fe69fde..b74ddccd51b 100644
--- a/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.cpp
+++ b/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.cpp
@@ -60,7 +60,7 @@ namespace StockBroker_Impl
if (iter != this->subscribed_stock_list_.end ())
{
this->subscribed_stock_list_.erase (iter);
- }
+ }
}
else
{
@@ -88,7 +88,9 @@ namespace StockBroker_Impl
ACE_CHECK;
if (CORBA::is_nil (quoter_obj.in ()))
- ACE_THROW (CORBA::BAD_PARAM ());
+ {
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
Stock::StockInfo_var info = quoter_obj->get_stock_info (stock_name.in () ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
@@ -114,10 +116,10 @@ namespace StockBroker_Impl
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
- if (0 == this->context_)
- {
+ if (0 == this->context_)
+ {
ACE_THROW (CORBA::INTERNAL ());
- }
+ }
}
void
diff --git a/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.h b/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.h
index 191148ec846..4fd1be99b8e 100644
--- a/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.h
+++ b/TAO/CIAO/DAnCE/examples/Quoter/Broker/Broker_exec.h
@@ -59,7 +59,7 @@ namespace StockBroker_Impl
ACE_THROW_SPEC ((CORBA::SystemException,
Stock::Invalid_Stock));
- virtual void
+ virtual void
push_notify_in (
::Stock::StockName *ev
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
@@ -127,7 +127,7 @@ namespace StockBroker_Impl
*/
class BROKER_EXEC_Export StockBrokerHome_exec_i
: public virtual StockBrokerHome_Exec,
- public virtual TAO_Local_RefCounted_Object
+ public virtual TAO_Local_RefCounted_Object
{
public:
StockBrokerHome_exec_i (void);
diff --git a/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor.cpp b/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor.cpp
index e413f0b019f..cf8c09202d7 100644
--- a/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor.cpp
+++ b/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor.cpp
@@ -22,33 +22,33 @@ parse_args (int argc, char *argv[])
while ((c = get_opts ()) != -1)
{
- switch (c)
- {
+ switch (c)
+ {
case 'k':
distributor_ior = get_opts.opt_arg ();
break;
- case 'o':
+ case 'o':
turn_on = 1;
- break;
+ break;
- case 'f':
- turn_on = 0;
- break;
+ case 'f':
+ turn_on = 0;
+ break;
- case 'r':
- rate = atoi (get_opts.opt_arg ());
- break;
+ case 'r':
+ rate = atoi (get_opts.opt_arg ());
+ break;
- case '?':
+ case '?':
default:
ACE_ERROR_RETURN ((LM_ERROR,
"usage: %s\n"
"-o (Start the distribution service)\n"
"-f (Stop the distribution service)\n"
- "-k <Distributor IOR> (default is file:\\distributor.ior) \n"
- "-r <broadcast frequency in Hertz> (default is 2)\n"
- "\n",
+ "-k <Distributor IOR> (default is file:\\distributor.ior) \n"
+ "-r <broadcast frequency in Hertz> (default is 2)\n"
+ "\n",
argv [0]),
-1);
}
@@ -69,7 +69,9 @@ int main (int argc, char* argv[])
ACE_TRY_CHECK;
if (parse_args (argc, argv) != 0)
+ {
return -1;
+ }
// create the factory object reference,
CORBA::Object_var distributor_obj =
@@ -78,39 +80,39 @@ int main (int argc, char* argv[])
ACE_TRY_CHECK;
// downcast the object reference to the appropriate type
- Stock::StockDistributor_var distributor =
- Stock::StockDistributor::_narrow (distributor_obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ Stock::StockDistributor_var distributor =
+ Stock::StockDistributor::_narrow (distributor_obj.in ()
+ ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
- if (CORBA::is_nil (distributor.in ()))
- {
+ if (CORBA::is_nil (distributor.in ()))
+ {
ACE_ERROR_RETURN ((LM_ERROR,
"Unable to acquire 'Distributor' objref\n"),
-1);
- }
+ }
- if (turn_on)
- {
- distributor->rate (rate
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ if (turn_on)
+ {
+ distributor->rate (rate
+ ACE_ENV_ARG_PARAMETER);
+ ACE_TRY_CHECK;
- ACE_DEBUG ((LM_DEBUG, "Start up the Distribution service\n"));
+ ACE_DEBUG ((LM_DEBUG, "Start up the Distribution service\n"));
- distributor->start (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
- else
- {
- ACE_DEBUG ((LM_DEBUG, "Stop the Distribution service\n"));
+ distributor->start (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
+ }
+ else
+ {
+ ACE_DEBUG ((LM_DEBUG, "Stop the Distribution service\n"));
distributor->stop (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
- }
+ ACE_TRY_CHECK;
+ }
orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ ACE_TRY_CHECK;
}
ACE_CATCHANY
{
diff --git a/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.cpp b/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.cpp
index 21f7e4b1c1c..95cbef0b72d 100644
--- a/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.cpp
+++ b/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.cpp
@@ -14,7 +14,6 @@ namespace StockDistributor_Impl
{
// initialze the stock values
-
CORBA::Long
StockDistributor_exec_i::ibm_ = 100;
@@ -40,7 +39,8 @@ namespace StockDistributor_Impl
int
pulse_Generator::open ()
{
- return this->activate (); // convert the task into a active object that runs in separate thread
+ // convert the task into a active object that runs in separate thread
+ return this->activate ();
}
int
@@ -48,7 +48,8 @@ namespace StockDistributor_Impl
{
this->reactor ()->end_reactor_event_loop ();
- return this->wait (); // wait for all threads in the task to exit before it returns
+ // wait for all threads in the task to exit before it returns
+ return this->wait ();
}
int
@@ -182,7 +183,9 @@ namespace StockDistributor_Impl
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (this->rate_ == 0 || this->pulser_.active())
- ACE_THROW (CORBA::BAD_PARAM ());
+ {
+ ACE_THROW (CORBA::BAD_PARAM ());
+ }
this->pulser_.start (this->rate_);
}
@@ -193,7 +196,9 @@ namespace StockDistributor_Impl
ACE_THROW_SPEC ((CORBA::SystemException))
{
if (! this->pulser_.active ())
+ {
ACE_THROW (CORBA::BAD_INV_ORDER ());
+ }
this->pulser_.stop ();
}
diff --git a/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.h b/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.h
index d3565334746..400501252d7 100644
--- a/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.h
+++ b/TAO/CIAO/DAnCE/examples/Quoter/Distributor/Distributor_exec.h
@@ -43,10 +43,10 @@ namespace StockDistributor_Impl
public virtual TAO_Local_RefCounted_Object
{
public:
- StockQuoter_exec_i (StockDistributor_exec_i &distributor)
+ StockQuoter_exec_i (StockDistributor_exec_i &distributor)
:distributor_ (distributor)
- {
- }
+ {
+ }
// Operations from ::Stock::StockQuoter
@@ -58,7 +58,8 @@ namespace StockDistributor_Impl
::CORBA::SystemException,
::Stock::Invalid_Stock));
- /// User defined
+ /// User defined
+
private:
/// Maintains a handle to the distributor so that the quoter can refer to it for latest quote
StockDistributor_exec_i &distributor_;
@@ -79,19 +80,19 @@ namespace StockDistributor_Impl
~pulse_Generator ();
- /// Hook method that performs application-defined initialization activities
+ /// Hook method that performs application-defined initialization activities
int open (void);
- /// Hook method that performs application-defined destruction activites
+ /// Hook method that performs application-defined destruction activites
int close (void);
- /// appliation-defined method for starting the pulse-generation service
+ /// appliation-defined method for starting the pulse-generation service
int start (CORBA::Long hertz);
- /// application-defined method for stopping the pulse-generation service
+ /// application-defined method for stopping the pulse-generation service
int stop (void);
- /// Indicate whether the current object is active
+ /// Indicate whether the current object is active
int active (void);
/// Handle the timeout.
@@ -100,17 +101,17 @@ namespace StockDistributor_Impl
/// Called when timer handler is removed.
virtual int handle_close (ACE_HANDLE handle,
- ACE_Reactor_Mask close_mask);
+ ACE_Reactor_Mask close_mask);
/// Hook methods implemnting the task's service processing,
- /// invoked by all threads activated by activate () method
+ /// invoked by all threads activated by activate () method
virtual int svc (void);
private:
/// Tracking whether we are actively generating pulse or not.
int active_;
- /// Maintains a handle that actually process the event
+ /// Maintains a handle that actually process the event
StockDistributor_exec_i *pulse_callback_;
};
@@ -221,19 +222,19 @@ namespace StockDistributor_Impl
));
private:
- /// pulse generation rate
- CORBA::Long rate_;
+ /// pulse generation rate
+ CORBA::Long rate_;
- /// pulser object
- pulse_Generator pulser_;
+ /// pulser object
+ pulse_Generator pulser_;
- /// "real-time" stock value
- static CORBA::Long msft_;
+ /// "real-time" stock value
+ static CORBA::Long msft_;
- /// "real-tiime" stock value
- static CORBA::Long ibm_;
+ /// "real-tiime" stock value
+ static CORBA::Long ibm_;
- friend class StockQuoter_exec_i;
+ friend class StockQuoter_exec_i;
};