summaryrefslogtreecommitdiff
path: root/TAO/examples/Persistent_Grid
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/examples/Persistent_Grid')
-rw-r--r--TAO/examples/Persistent_Grid/Grid_Client_i.cpp22
-rw-r--r--TAO/examples/Persistent_Grid/Grid_i.cpp32
-rw-r--r--TAO/examples/Persistent_Grid/Grid_i.h30
-rw-r--r--TAO/examples/Persistent_Grid/Persistent_Client_i.cpp22
-rw-r--r--TAO/examples/Persistent_Grid/Simple_util.cpp40
-rw-r--r--TAO/examples/Persistent_Grid/Simple_util.h11
-rw-r--r--TAO/examples/Persistent_Grid/server.cpp8
7 files changed, 81 insertions, 84 deletions
diff --git a/TAO/examples/Persistent_Grid/Grid_Client_i.cpp b/TAO/examples/Persistent_Grid/Grid_Client_i.cpp
index c7f5bf8a6e3..447dc531ba2 100644
--- a/TAO/examples/Persistent_Grid/Grid_Client_i.cpp
+++ b/TAO/examples/Persistent_Grid/Grid_Client_i.cpp
@@ -67,15 +67,15 @@ Grid_Client_i::run (const char *name,
if (this->parse_args (argc, argv) == -1)
return -1;
- ACE_DECLARE_NEW_CORBA_ENV;
+ TAO_ENV_DECLARE_NEW_ENV;
ACE_TRY
{
// Make the Grid.
Grid_ptr grid = client->make_grid (width_,
- height_,
- ACE_TRY_ENV);
+ height_
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG,
@@ -90,21 +90,21 @@ Grid_Client_i::run (const char *name,
// Set a value on the grid
grid->set (index_,
ctr,
- (value_ + ctr),
- ACE_TRY_ENV);
+ (value_ + ctr)
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
-
+
}
}
-
+
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Setting a value for the grid\n"));
-
+
ACE_TRY_CHECK;
-
+
if (client.shutdown () == 1) {
- client->shutdown (ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ client->shutdown (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
}
}
diff --git a/TAO/examples/Persistent_Grid/Grid_i.cpp b/TAO/examples/Persistent_Grid/Grid_i.cpp
index 8a03929cf5b..29f586b7808 100644
--- a/TAO/examples/Persistent_Grid/Grid_i.cpp
+++ b/TAO/examples/Persistent_Grid/Grid_i.cpp
@@ -62,8 +62,8 @@ Grid_i::~Grid_i (void)
void
Grid_i::set (CORBA::Short x,
CORBA::Short y,
- CORBA::Long value,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Long value
+ TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
Grid::RANGE_ERROR))
{
@@ -80,8 +80,8 @@ Grid_i::set (CORBA::Short x,
CORBA::Long
Grid_i::get (CORBA::Short x,
- CORBA::Short y,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Short y
+ TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException,
Grid::RANGE_ERROR))
{
@@ -97,30 +97,30 @@ Grid_i::get (CORBA::Short x,
// Access methods.
CORBA::Short
-Grid_i::width (CORBA::Environment &)
+Grid_i::width (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
return this->width_;
}
CORBA::Short
-Grid_i::height (CORBA::Environment &)
+Grid_i::height (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
return this->height_;
}
void
-Grid_i::width (CORBA::Short x,
- CORBA::Environment &)
+Grid_i::width (CORBA::Short x
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->width_ = x;
}
void
-Grid_i::height (CORBA::Short y,
- CORBA::Environment &)
+Grid_i::height (CORBA::Short y
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
this->height_ = y;
@@ -128,7 +128,7 @@ Grid_i::height (CORBA::Short y,
// Destroy the grid
void
-Grid_i::destroy (CORBA::Environment & )
+Grid_i::destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED )
ACE_THROW_SPEC ((CORBA::SystemException))
{
// Delete the array.
@@ -179,8 +179,8 @@ Grid_Factory_i::~Grid_Factory_i (void)
Grid_ptr
Grid_Factory_i::make_grid (CORBA::Short width,
- CORBA::Short height,
- CORBA::Environment &ACE_TRY_ENV)
+ CORBA::Short height
+ TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_DEBUG ((LM_DEBUG,
@@ -215,7 +215,7 @@ Grid_Factory_i::make_grid (CORBA::Short width,
grid_ptr->set_pool (pool_t_);
// Register the Grid pointer.
- return grid_ptr->_this (ACE_TRY_ENV);
+ return grid_ptr->_this (TAO_ENV_SINGLE_ARG_PARAMETER);
}
// Set the ORB pointer.
@@ -228,7 +228,7 @@ Grid_Factory_i::orb (CORBA::ORB_ptr o)
// Shutdown.
void
-Grid_Factory_i::shutdown (CORBA::Environment &)
+Grid_Factory_i::shutdown (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
ACE_DEBUG ((LM_DEBUG,
@@ -240,7 +240,7 @@ Grid_Factory_i::shutdown (CORBA::Environment &)
}
void
-Grid_Factory_i::cleanup (CORBA::Environment &)
+Grid_Factory_i::cleanup (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException))
{
const char *name = "Array";
diff --git a/TAO/examples/Persistent_Grid/Grid_i.h b/TAO/examples/Persistent_Grid/Grid_i.h
index ea6e06cc8de..8598f2a4658 100644
--- a/TAO/examples/Persistent_Grid/Grid_i.h
+++ b/TAO/examples/Persistent_Grid/Grid_i.h
@@ -42,16 +42,16 @@ public:
virtual Grid_ptr make_grid (CORBA::Short,
- CORBA::Short,
- CORBA::Environment &_env)
+ CORBA::Short
+ TAO_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
// This function creates and returns a <Grid>.
- virtual void shutdown (CORBA::Environment &env)
+ virtual void shutdown (TAO_ENV_SINGLE_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException));
// Shutdown the server.
- virtual void cleanup (CORBA::Environment & )
+ virtual void cleanup (TAO_ENV_SINGLE_ARG_DECL_NOT_USED )
ACE_THROW_SPEC ((CORBA::SystemException));
// Do a clean up of the memory map
@@ -98,40 +98,40 @@ public:
~Grid_i (void);
// Destructor
- virtual CORBA::Short width (CORBA_Environment &)
+ virtual CORBA::Short width (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException));
// Returns the width of the grid
- virtual CORBA::Short height (CORBA_Environment &)
+ virtual CORBA::Short height (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException));
// Returns the height of the grid
- virtual void width (CORBA::Short,
- CORBA_Environment &)
+ virtual void width (CORBA::Short
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException));
// Sets the width of the grid.
- virtual void height (CORBA::Short,
- CORBA_Environment &)
+ virtual void height (CORBA::Short
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException));
// Sets the height of the grid.
virtual void set (CORBA::Short,
CORBA::Short,
- CORBA::Long,
- CORBA::Environment &)
+ CORBA::Long
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
Grid::RANGE_ERROR));
// Sets the grid value.
virtual CORBA::Long get (CORBA::Short,
- CORBA::Short,
- CORBA::Environment &)
+ CORBA::Short
+ TAO_ENV_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException,
Grid::RANGE_ERROR));
// Gets the grid value.
- virtual void destroy (CORBA::Environment &)
+ virtual void destroy (TAO_ENV_SINGLE_ARG_DECL_NOT_USED)
ACE_THROW_SPEC ((CORBA::SystemException));
// Destroy the grid.
diff --git a/TAO/examples/Persistent_Grid/Persistent_Client_i.cpp b/TAO/examples/Persistent_Grid/Persistent_Client_i.cpp
index fc3a9fa015c..d394ed0279e 100644
--- a/TAO/examples/Persistent_Grid/Persistent_Client_i.cpp
+++ b/TAO/examples/Persistent_Grid/Persistent_Client_i.cpp
@@ -58,42 +58,42 @@ Persistent_Client_i::run (const char *name,
if (this->parse_args (argc, argv) == -1)
return -1;
- ACE_DECLARE_NEW_CORBA_ENV;
+ TAO_ENV_DECLARE_NEW_ENV;
ACE_TRY
{
// Make the Grid.
Grid_ptr grid = client->make_grid (width_,
- height_,
- ACE_TRY_ENV);
+ height_
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) Made the grid succesfully\n"));
-
+
for (CORBA::Short index_ = 0; index_ < height_; index_++)
{
for (CORBA::Short ctr = 0; ctr < width_; ctr++)
{
CORBA::Long ret_val = grid->get (index_,
- ctr,
- ACE_TRY_ENV);
+ ctr
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG,
"Grid value [%d][%d] = %d \n",index_, ctr,ret_val));
}
}
-
+
if (client.shutdown () == 1) {
- client->shutdown (ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ client->shutdown (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
}
if (this->remove_ == 1) {
- client->cleanup (ACE_TRY_ENV);
- ACE_TRY_CHECK;
+ client->cleanup (TAO_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
}
}
ACE_CATCH (CORBA::UserException, range_ex)
diff --git a/TAO/examples/Persistent_Grid/Simple_util.cpp b/TAO/examples/Persistent_Grid/Simple_util.cpp
index 26c45b0dd80..647be2151c8 100644
--- a/TAO/examples/Persistent_Grid/Simple_util.cpp
+++ b/TAO/examples/Persistent_Grid/Simple_util.cpp
@@ -68,15 +68,15 @@ Server<Servant>::parse_args (void)
template <class Servant> int
Server<Servant>::init (const char *servant_name,
int argc,
- char *argv[],
- CORBA::Environment &ACE_TRY_ENV)
+ char *argv[]
+ TAO_ENV_ARG_DECL)
{
// Call the init of <TAO_ORB_Manager> to initialize the ORB and
// create a child POA under the root POA.
if (this->orb_manager_.init_child_poa (argc,
argv,
- "child_poa",
- ACE_TRY_ENV) == -1)
+ "child_poa"
+ TAO_ENV_ARG_PARAMETER) == -1)
ACE_ERROR_RETURN ((LM_ERROR,
"%p\n",
"init_child_poa"),
@@ -108,8 +108,8 @@ Server<Servant>::init (const char *servant_name,
{
CORBA::String_var str =
this->orb_manager_.activate_under_child_poa (servant_name,
- &this->servant_,
- ACE_TRY_ENV);
+ &this->servant_
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
ACE_DEBUG ((LM_DEBUG,
@@ -117,12 +117,12 @@ Server<Servant>::init (const char *servant_name,
str.in ()));
if (this->ior_output_file_)
- {
- ACE_OS::fprintf (this->ior_output_file_,
- "%s",
- str.in ());
- ACE_OS::fclose (this->ior_output_file_);
- }
+ {
+ ACE_OS::fprintf (this->ior_output_file_,
+ "%s",
+ str.in ());
+ ACE_OS::fclose (this->ior_output_file_);
+ }
}
ACE_CATCHANY
@@ -138,10 +138,10 @@ Server<Servant>::init (const char *servant_name,
}
template <class Servant> int
-Server<Servant>::run (CORBA::Environment &ACE_TRY_ENV)
+Server<Servant>::run (TAO_ENV_SINGLE_ARG_DECL)
{
// Run the main event loop for the ORB.
- int ret = this->orb_manager_.run (ACE_TRY_ENV);
+ int ret = this->orb_manager_.run (TAO_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
if (ret == -1)
@@ -245,15 +245,15 @@ Client<InterfaceObj, Var>::init (const char * /*name*/,
this->argc_ = argc;
this->argv_ = argv;
- ACE_DECLARE_NEW_CORBA_ENV;
+ TAO_ENV_DECLARE_NEW_ENV;
ACE_TRY
{
// Retrieve the ORB.
this->orb_ = CORBA::ORB_init (this->argc_,
this->argv_,
- 0,
- ACE_TRY_ENV);
+ 0
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
// Parse command line and verify parameters.
@@ -263,7 +263,7 @@ Client<InterfaceObj, Var>::init (const char * /*name*/,
if(this->ior_ != 0)
{
CORBA::Object_var server_object =
- this->orb_->string_to_object (this->ior_, ACE_TRY_ENV);
+ this->orb_->string_to_object (this->ior_ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
@@ -272,8 +272,8 @@ Client<InterfaceObj, Var>::init (const char * /*name*/,
"invalid ior <%s>\n",
this->ior_),
-1);
- this->server_ = InterfaceObj::_narrow (server_object.in (),
- ACE_TRY_ENV);
+ this->server_ = InterfaceObj::_narrow (server_object.in ()
+ TAO_ENV_ARG_PARAMETER);
ACE_TRY_CHECK;
}
else
diff --git a/TAO/examples/Persistent_Grid/Simple_util.h b/TAO/examples/Persistent_Grid/Simple_util.h
index d0b689a685b..e95c2f3173c 100644
--- a/TAO/examples/Persistent_Grid/Simple_util.h
+++ b/TAO/examples/Persistent_Grid/Simple_util.h
@@ -46,8 +46,8 @@ public:
int init (const char *servant_name,
int argc,
- char *argv[],
- CORBA::Environment &env);
+ char *argv[]
+ TAO_ENV_ARG_DECL);
// Initialize the Server state - parsing arguments and waiting.
// interface_name is the name used to register the Servant.
@@ -55,7 +55,7 @@ public:
// After calling <init>, this method will register the server with
// the TAO Naming Service using the servant_name passed to <init>.
- int run (CORBA::Environment &env);
+ int run (TAO_ENV_SINGLE_ARG_DECL);
// Run the orb.
protected:
@@ -120,7 +120,7 @@ public:
void shutdown (int);
// Fills in the shutdwon flag.
- int obtain_initial_references (CORBA::Environment &);
+ int obtain_initial_references (TAO_ENV_SINGLE_ARG_DECL_NOT_USED);
// Initialize naming service
protected:
@@ -142,9 +142,6 @@ protected:
char *ior_;
// IOR of the obj ref of the server.
- CORBA::Environment env_;
- // Environment variable.
-
int naming_;
// Flag to use the naming service
diff --git a/TAO/examples/Persistent_Grid/server.cpp b/TAO/examples/Persistent_Grid/server.cpp
index d2f159e12a6..76fa1e1d145 100644
--- a/TAO/examples/Persistent_Grid/server.cpp
+++ b/TAO/examples/Persistent_Grid/server.cpp
@@ -13,18 +13,18 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG,
"\n\tGrid server\n\n"));
- ACE_DECLARE_NEW_CORBA_ENV;
+ TAO_ENV_DECLARE_NEW_ENV;
ACE_TRY
{
if (server.init ("Grid",
argc,
- argv,
- ACE_TRY_ENV) == -1)
+ argv
+ TAO_ENV_ARG_PARAMETER) == -1)
return 1;
else
{
- server.run (ACE_TRY_ENV);
+ server.run (TAO_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
}
}