diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:11 +0000 |
commit | 6b846cf03c0bcbd8c276cb0af61a181e5f98eaae (patch) | |
tree | da50d054f9c761c3f6a5923f6979e93306c56d68 /TAO/examples/Simple | |
parent | 0e555b9150d38e3b3473ba325b56db2642e6352b (diff) | |
download | ATCD-6b846cf03c0bcbd8c276cb0af61a181e5f98eaae.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/examples/Simple')
87 files changed, 0 insertions, 6501 deletions
diff --git a/TAO/examples/Simple/Makefile.am b/TAO/examples/Simple/Makefile.am deleted file mode 100644 index 19db928b1da..00000000000 --- a/TAO/examples/Simple/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -SUBDIRS = \ - bank \ - chat \ - echo \ - grid \ - time-date \ - time - diff --git a/TAO/examples/Simple/README b/TAO/examples/Simple/README deleted file mode 100644 index d753ece9ea5..00000000000 --- a/TAO/examples/Simple/README +++ /dev/null @@ -1,28 +0,0 @@ -$Id$ - -This directory contains a number of very simple tests, which also -illustrate how to write canonical Orbix/VisiBroker/OmniORB examples in -TAO using standard CORBA features rather than proprietary ORB -features. The individual directories contain READMEs on how to run -the following tests: - - . bank - - This directory implements the canonical VisiBroker - test. - - . chat - - This directory implements an ORBacus test. - - . echo - - This directory implements the canonical omniORB test. - - . grid - - This directory implements the canonical Orbix test. - - . time - - This directory implements a simple time/date test. diff --git a/TAO/examples/Simple/Simple_util.cpp b/TAO/examples/Simple/Simple_util.cpp deleted file mode 100644 index 6a1e517f271..00000000000 --- a/TAO/examples/Simple/Simple_util.cpp +++ /dev/null @@ -1,492 +0,0 @@ -// $Id$ - -#ifndef SIMPLE_UTIL_C -#define SIMPLE_UTIL_C - -#include "Simple_util.h" -#include "tao/IORTable/IORTable.h" -#include "tao/debug.h" -#include "ace/OS_NS_stdio.h" -#include "ace/OS_NS_unistd.h" -#include "ace/OS_NS_string.h" -#include "ace/OS_NS_fcntl.h" - -// Constructor. - -template <class Servant> -Server<Servant>::Server (void) - : ior_output_file_ (0), - naming_ (0), - ins_ (0) -{ - // no-op. -} - -// Destructor. - -template <class Servant> -Server<Servant>::~Server (void) -{ -} - -// Parse the command-line arguments and set options. - -template <class Servant> int -Server<Servant>::parse_args (void) -{ - ACE_Get_Opt get_opts (this->argc_, this->argv_, "do:ni:"); - int c = 0; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag. - TAO_debug_level++; - break; - case 'o': // output the IOR to a file. - this->ior_output_file_ = ACE_OS::fopen (get_opts.opt_arg (), "w"); - if (this->ior_output_file_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - get_opts.opt_arg ()), -1); - break; - - case 'n': //Use naming service - this->naming_ = 1; - break; - case 'i': // For Testing the InterOperable Naming Service. - this->ins_ = CORBA::string_dup (get_opts.opt_arg ()); - break; - case 'h': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d (debug)]" - " [-o] <ior_output_file>" - " [-n (use naming service)]" - " [-i] <InterOperable Naming Service simple object key>" - " [-h (help)]" - "\n", - argv_ [0]), - -1); - } - - // Indicates successful parsing of command line. - return 0; -} - -// Add the ObjectID:IOR mapping to the IOR table of -// the ORB. Ignore this method if you are not testing for -// the InterOperable Naming Service. - -template <class Servant> int -Server<Servant>::test_for_ins (CORBA::String_var ior) -{ - CORBA::ORB_var orb = this->orb_manager_.orb (); - - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "Adding (KEY:IOR) %s:%s\n", - this->ins_, - ior.in ())); - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - CORBA::Object_var table_object = - orb->resolve_initial_references ("IORTable" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (CORBA::is_nil (adapter.in ())) - { - ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); - } - - adapter->bind (this->ins_, ior.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; - - return 0; -} - -// Initialize the server. -template <class Servant> int -Server<Servant>::init (const char *servant_name, - int argc, - char *argv[] - ACE_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_ENV_ARG_PARAMETER) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "init_child_poa"), - -1); - - ACE_CHECK_RETURN (-1); - - this->argc_ = argc; - this->argv_ = argv; - - int retval = this->parse_args (); - - if (retval != 0) - return retval; - - CORBA::ORB_var orb = this->orb_manager_.orb (); - - // Stash our ORB pointer for later reference. - this->servant_.orb (orb.in ()); - - if (this->naming_ == 1) - { - - // Save name in case we use TAO Naming Service. - name = servant_name; - - // Call naming service - if (this->register_name () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "\n Naming Service\n"),-1); - - return 0; - } - - // Activate the servant in its own child POA. - - // Make sure that you check for failures here via the ACE_TRY - // macros?! - ACE_TRY - { - CORBA::String_var str = - this->orb_manager_.activate_under_child_poa (servant_name, - &this->servant_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "The IOR is: <%s>\n", - str.in ())); - - if (this->ins_) - if (this->test_for_ins (str) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "test_for_ins (): failed\n"), - -1); - - if (this->ior_output_file_) - { - ACE_OS::fprintf (this->ior_output_file_, - "%s", - str.in ()); - ACE_OS::fclose (this->ior_output_file_); - } - - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"\tException in activation of POA"); - return -1; - } - ACE_ENDTRY; - - return 0; -} - -template <class Servant>int -Server<Servant>::run (ACE_ENV_SINGLE_ARG_DECL) -{ - // Run the main event loop for the ORB. - if (this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Server_i::run"), - -1); - - return 0; -} - -template <class Servant> int -Server<Servant>::register_name (void) -{ - CORBA::ORB_var orb = this->orb_manager_.orb (); - - if (this->naming_client_.init (orb.in ()) == -1) - return -1; - - // create the name for the naming service - CosNaming::Name bindName; - bindName.length (1); - bindName[0].id = CORBA::string_dup (name); - - ACE_DECLARE_NEW_CORBA_ENV; - - // (re)Bind the object. - ACE_TRY - { - CORBA::Object_var object = servant_._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->orb_manager_.activate_poa_manager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - naming_client_->rebind (bindName, - object.in() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Test for INS. - if (this->ins_) - { - CORBA::String_var ior = - orb->object_to_string (object.in ()); - if (this->test_for_ins (ior.in ()) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "test_for_ins (): failed\n"), - -1); - } - } - ACE_CATCH (CosNaming::NamingContext::AlreadyBound, ex) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to bind %s \n", - name), - -1); - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - return 0; -} - -// Constructor. - -template <class INTERFACE_OBJECT, class Var> -Client<INTERFACE_OBJECT, Var>::Client (void) - : ior_ (0), - shutdown_ (0) -{ - //no-op -} - -// Reads the Server ior from a file - -template <class INTERFACE_OBJECT, class Var> int -Client<INTERFACE_OBJECT, Var>::read_ior (char *filename) -{ - // Open the file for reading. - ACE_HANDLE f_handle = ACE_OS::open (filename, 0); - - if (f_handle == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - filename), - -1); - - ACE_Read_Buffer ior_buffer (f_handle); - char *data = ior_buffer.read (); - - if (data == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior: %p\n"), - -1); - - this->ior_ = ACE_OS::strdup (data); - ior_buffer.alloc ()->free (data); - - ACE_OS::close (f_handle); - - return 0; -} - -// Parses the command line arguments and returns an error status. - -template <class INTERFACE_OBJECT, class Var> int -Client<INTERFACE_OBJECT, Var>::parse_args (void) -{ - ACE_Get_Opt get_opts (argc_, argv_, "df:nk:x"); - int c = 0; - int result = 0; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag - TAO_debug_level++; - break; - case 'k': // ior provide on command line - this->ior_ = ACE_OS::strdup (get_opts.opt_arg ()); - break; - case 'n': // Use naming service - this->naming_ = 1; - break; - case 'f': // read the IOR from the file. - result = this->read_ior (get_opts.opt_arg ()); - if (result < 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior from %s : %p\n", - get_opts.opt_arg ()), - -1); - break; - case 'x': // read the flag for shutting down - this->shutdown_ = 1; - break; - case 'h': // display help for use of the client. - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d (debug)]" - " [-k] <ior>" - " [-f] <ior_output_file>" - " [-n (use naming service)]" - " [-x (shutdown server)]" - " [-h (help)]" - "\n", - argv_ [0]), - -1); - } - - // Indicates successful parsing of command line. - return 0; -} - -template <class INTERFACE_OBJECT, class Var> -Client<INTERFACE_OBJECT, Var>::~Client (void) -{ - ACE_OS::free (this->ior_); -} - -template <class INTERFACE_OBJECT, class Var> int -Client<INTERFACE_OBJECT, Var>::init (const char *name, - int argc, - char **argv) -{ - this->argc_ = argc; - this->argv_ = argv; - - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - // Retrieve the ORB. - this->orb_ = CORBA::ORB_init (this->argc_, - this->argv_, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Parse command line and verify parameters. - if (this->parse_args () == -1) - return -1; - - if(this->ior_ != 0) - { - CORBA::Object_var server_object = - this->orb_->string_to_object (this->ior_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - - if (CORBA::is_nil (server_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "invalid ior <%s>\n", - this->ior_), - -1); - this->server_ = INTERFACE_OBJECT::_narrow (server_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - else if (this->naming_ == 1) - { - // No IOR specified. Use the Naming Service - ACE_DEBUG((LM_DEBUG, - "Using the Naming Service \n")); - this->name_ = const_cast<char *> (name); - int retv = this->obtain_initial_references (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - if (retv ==-1) - return -1; - } - else - ACE_ERROR_RETURN ((LM_ERROR, - "no ior or naming options specified\n"), - -1); - - - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Client_i::init"); - return -1; - } - ACE_ENDTRY; - - - return 0; -} - - -template <class INTERFACE_OBJECT, class Var> int -Client<INTERFACE_OBJECT, Var>::obtain_initial_references (ACE_ENV_SINGLE_ARG_DECL) -{ - - ACE_TRY - { - // Initialize the naming services. - if (naming_client_.init (orb_.in ()) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "[CLIENT] Process/Thread Id : (%P/%t) Unable to initialize " - "the TAO_Naming_Client. \n"), - -1); - - - CosNaming::Name server_name (1); - server_name.length (1); - server_name[0].id = - CORBA::string_dup (this->name_); - CORBA::Object_var obj = - naming_client_->resolve (server_name - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->server_ = INTERFACE_OBJECT::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Client::obtain_initial_references"); - return -1; - } - ACE_ENDTRY; - - return 0; -} - -template <class INTERFACE_OBJECT, class Var> int -Client<INTERFACE_OBJECT, Var>::shutdown (void) -{ - // Returns the shutdwon flag - return shutdown_; -} - -template <class INTERFACE_OBJECT, class Var> void -Client<INTERFACE_OBJECT, Var>::shutdown (int flag) -{ - // Fills the flag - shutdown_ = flag; -} - -#endif /* SIMPLE_UTIL_C */ diff --git a/TAO/examples/Simple/Simple_util.h b/TAO/examples/Simple/Simple_util.h deleted file mode 100644 index 453335f52f3..00000000000 --- a/TAO/examples/Simple/Simple_util.h +++ /dev/null @@ -1,176 +0,0 @@ -//$Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple -// -// = FILENAME -// Simple_Util.h -// -// = DESCRIPTION -// The classe define the templates for the client and server. -// -// = AUTHOR -// Balachandran Natarajan <bala@cs.wustl.edu> -// -// ============================================================================ - -#ifndef TAO_UTIL_H -#define TAO_UTIL_H - -#include "tao/Utils/ORB_Manager.h" -#include "orbsvcs/Naming/Naming_Client.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" - -template <class Servant> -class Server -{ - // = TITLE - // A set of useful class Templates for using the TAO CORBA - // implementation. - // - // = DESCRIPTION - // A template server definition. This template can be used by - // single server/client projects for defintion of their - // server/clients. See the directories time, bank, echo for - // further details of implemenatation. -public: - // = Initialization and termination methods. - - Server (void); - // Constructor. - - ~Server (void); - // Destructor. - - int init (const char *servant_name, - int argc, - char *argv[] - ACE_ENV_ARG_DECL); - // Initialize the Server state - parsing arguments and waiting. - // interface_name is the name used to register the Servant. - - int register_name (void); - // After calling <init>, this method will register the server with - // the TAO Naming Service using the servant_name passed to <init>. - - int run (ACE_ENV_SINGLE_ARG_DECL); - // Run the orb. - - int test_for_ins (CORBA::String_var ior); - // Ignore this method if you are not testing the InterOperable - // Naming Service. - -protected: - Servant servant_; - // Servant class - - const char *name; - // name of the servant to be used for TAO Naming Service - - int parse_args (void); - // Parses the commandline arguments. - - TAO_ORB_Manager orb_manager_; - // The ORB manager - a helper class for accessing the POA and - // registering objects. - - TAO_Naming_Client naming_client_; - // helper class for getting access to Naming Service. - - FILE *ior_output_file_; - // File where the IOR of the server object is stored. - - int naming_; - // Flag to indicate whether naming service could be used - - char *ins_; - // Used test the INS. - - int argc_; - // Number of command line arguments. - - char **argv_; - // The command line arguments. -}; - -template <class INTERFACE_OBJECT, class Var> -class Client -{ - // = TITLE - // Template Client class - // - // = DESCRIPTION - // A template client implementation for a single server/client - // model. The example usage of these usage can be found in the - // sub-directories below -public: - - // = Initialization and termination methods. - Client (void); - // Constructor. - - ~Client (void); - // Destructor. - - int init (const char *name,int argc, char *argv[]); - // Initialize the client communication endpoint with server. - - INTERFACE_OBJECT *operator-> () { return server_.in ();}; - // Return the interface object pointer. - - int shutdown (void ); - // Returns the shutdown flag. - - void shutdown (int); - // Fills in the shutdwon flag. - - int obtain_initial_references (ACE_ENV_SINGLE_ARG_DECL); - // Initialize naming service - - CORBA::ORB_ptr orb (void) {return this->orb_.in ();} -protected: - CORBA::ORB_var orb_; - // Remember our orb. - - int read_ior (char *filename); - // Function to read the server IOR from a file. - - int parse_args (void); - // Parses the arguments passed on the command line. - - TAO_Naming_Client naming_client_; - // helper class for getting access to Naming Service. - - int argc_; - // # of arguments on the command line. - - char **argv_; - // arguments from command line. - - char *ior_; - // IOR of the obj ref of the server. - - char *name_; - // Name to be usred for the naming service - - Var server_; - // Server object - - int naming_; - // Flag to use the naming service - - int shutdown_; - // Flag for shutting down the server -}; - -#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Simple_util.cpp" -#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ -#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) -#pragma implementation ("Simple_util.cpp") -#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ - -#endif /* TAO_UTIL_H */ diff --git a/TAO/examples/Simple/bank/AccountManager_i.cpp b/TAO/examples/Simple/bank/AccountManager_i.cpp deleted file mode 100644 index c6404e5ac28..00000000000 --- a/TAO/examples/Simple/bank/AccountManager_i.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// $Id$ - -#include "AccountManager_i.h" -#include "Account_i.h" -#include "tao/debug.h" -#include "tao/Utils/ORB_Manager.h" - -ACE_RCSID(AccountManager, AccountManager_i, "$Id$") - -// Constructor - -AccountManager_i::AccountManager_i (void) -{ - // no-op -} - -// Destructor - -AccountManager_i::~AccountManager_i (void) -{ - // no-op -} - -// Set the ORB pointer - -void -AccountManager_i::orb (CORBA::ORB_ptr o) -{ - this->orb_ = CORBA::ORB::_duplicate (o); -} - -void -AccountManager_i::poa (PortableServer::POA_ptr poa) -{ - this->poa_ = poa; -} - -void -AccountManager_i::set_orb_manager (TAO_ORB_Manager *orb_manager) -{ - this->orb_manager_ = orb_manager; -} - -// Open an account for the given name. - -Bank::Account_ptr -AccountManager_i::open (const char *name, - CORBA::Float initial_balance - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Account_i *result = 0; - - // If name is already in the map, <find> will assign <result> to the - // appropriate value. - - if (hash_map_.find (name, result) != 0) - { - ACE_DEBUG ((LM_DEBUG, - "[SERVER] Process/Thread Id : (%P/%t) Opening Account (%s,%8.2f)\n", - name, - initial_balance)); - - ACE_NEW_THROW_EX (result, - Account_i (name, - initial_balance), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (Bank::Account::_nil ()); - - // Enter the new Account in the hash map. If the <bind> fails - // throw an UNKNOWN exception. <result> may be valid but since - // it is not properly bound, it's behaviour may be off, so - // delete it to be safe. - - if (hash_map_.bind (name, result) == -1) - { - delete result; - ACE_THROW_RETURN (CORBA::UNKNOWN (), - Bank::Account::_nil ()); - } - } - else if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "[SERVER] Process/Thread Id : (%P/%t) Account already exists for %s\n", - name)); - // Generate an IOR for the result object and register it with the - // POA. In case the object already exists then the previously - // generated IOR is returned. - - return result->_this (); -} - -// Shutdown. - -void -AccountManager_i::close (Bank::Account_ptr account - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_TRY - { - CORBA::String_var name = - CORBA::string_dup (account->name (ACE_ENV_SINGLE_ARG_PARAMETER)); - - ACE_TRY_CHECK; - - if (hash_map_.unbind (name.in ()) == -1) - { - if (TAO_debug_level > 0) - ACE_DEBUG((LM_DEBUG, - "Unable to close account\n")); - } - else if (TAO_debug_level > 0) - ACE_DEBUG((LM_DEBUG, - "[SERVER] Process/Thread Id : (%P/%t) Closing Account for %s\n", - (char *) name)); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Unable to close Account\n"); - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -AccountManager_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "\n[SERVER] Process/Thread Id : (%P/%t) %s\n", - "AccountManager_i is shutting down")); - - // Instruct the ORB to shutdown. - this->orb_->shutdown (); -} - diff --git a/TAO/examples/Simple/bank/AccountManager_i.h b/TAO/examples/Simple/bank/AccountManager_i.h deleted file mode 100644 index ebae834858d..00000000000 --- a/TAO/examples/Simple/bank/AccountManager_i.h +++ /dev/null @@ -1,104 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple/Bank -// -// = FILENAME -// AccountManager_i.h -// -// = DESCRIPTION -// This class implements the Bank::AccountManager IDL interface. -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ - -#ifndef ACCOUNTMANAGER_I_H -#define ACCOUNTMANAGER_I_H - -#include "BankS.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Account_i.h" - -#include "ace/Hash_Map_Manager.h" -#include "ace/OS.h" -#include "ace/ACE.h" -#include "ace/SString.h" -#include "ace/Null_Mutex.h" - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL -class TAO_ORB_Manager; -TAO_END_VERSIONED_NAMESPACE_DECL - -class AccountManager_i : public POA_Bank::AccountManager -{ - // = TITLE - // Account Manager object implementation. - // - // = DESCRIPTION - // Implementation of a simple object that has two methods, one - // that returns an Account Interface and the other that shuts - // down the server. -public: - // = Initialization and termination methods. - AccountManager_i (void); - // Constructor. - - ~AccountManager_i (void); - // Destructor. - - virtual Bank::Account_ptr open (const char *name, - CORBA::Float initial_balance - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Return the Account interface with the given name from the server. - // Put the initial balance specified in the new account. - - virtual void close (Bank::Account_ptr - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Close the given account. - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Shutdown the server. - - void orb (CORBA::ORB_ptr o); - // Set the ORB pointer. - - void poa (PortableServer::POA_ptr poa); - // Set the POA pointer. - - void set_orb_manager (TAO_ORB_Manager *orb_manager); - // Set the ORB Manager. - - TAO_ORB_Manager *orb_manager_; - // The ORB manager. - -private: - CORBA::ORB_var orb_; - // ORB pointer. - - PortableServer::POA_ptr poa_; - // POA pointer. - - ACE_Hash_Map_Manager<ACE_CString, - Account_i *, - ACE_Null_Mutex> hash_map_; - // Calls to <open> will create a new instance of <Account_i> and - // bind into the hash map manager if <name> is unique, else it will - // return a previously bound entry. - - ACE_UNIMPLEMENTED_FUNC (void operator= (const AccountManager_i &)) - // Keeping g++2.7.2 -}; - -#endif /* ACCOUNTMANAGER_I_H */ diff --git a/TAO/examples/Simple/bank/Account_i.cpp b/TAO/examples/Simple/bank/Account_i.cpp deleted file mode 100644 index 2f150afc54a..00000000000 --- a/TAO/examples/Simple/bank/Account_i.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id$ - -#include "Account_i.h" - -ACE_RCSID(Bank, Account_i, "$Id$") - -// Constructor - -Account_i::Account_i (void) -{ - // no-op -} - -Account_i::Account_i (const char *name, - CORBA::Float balance) - - : balance_ (balance), - name_ (CORBA::string_dup (name)) -{ -} - -// Destructor - -Account_i::~Account_i (void) -{ - CORBA::string_free (name_); -} - -// Set the ORB pointer. - -void -Account_i::orb (CORBA::ORB_ptr o) -{ - this->orb_ = CORBA::ORB::_duplicate (o); -} - -// Return the current balance on the server. - -CORBA::Float -Account_i::balance (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return balance_; -} - -void -Account_i::deposit (CORBA::Float deposit - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - balance_ += deposit; -} - -void -Account_i::withdraw (CORBA::Float withdrawl - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Bank::Account::Overdraft)) -{ - if (balance_ >= withdrawl) - balance_ -= withdrawl; - else - ACE_THROW (Bank::Account::Overdraft ("Exception::Overdraft\n")); -} - -char * -Account_i::name (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::string_dup (this->name_.in ()); -} - -void -Account_i::name (const char *name - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->name_ = CORBA::string_dup (name); -} diff --git a/TAO/examples/Simple/bank/Account_i.h b/TAO/examples/Simple/bank/Account_i.h deleted file mode 100644 index 1190a811220..00000000000 --- a/TAO/examples/Simple/bank/Account_i.h +++ /dev/null @@ -1,84 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple/Bank -// -// = FILENAME -// Account_i.h -// -// = DESCRIPTION -// This class implements the Bank IDL interface. -// -// = AUTHOR -// Vishal Kachroo <vishal@cs.wustl.edu> -// -// ============================================================================ - -#ifndef ACCOUNT_I_H -#define ACCOUNT_I_H - -#include "BankS.h" - -class Account_i : public POA_Bank::Account -{ - // = TITLE - // Bank object implementation. - // - // = DESCRIPTION - // Implementation of a simple object that has two methods, one - // that return the current balance on the server and the other - // that shuts down the server. -public: - // = Initialization and termination methods. - Account_i (void); - // Constructor. - - Account_i (const char *, CORBA::Float); - // Constructor. - - ~Account_i (void); - // Destructor. - - virtual CORBA::Float balance (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Get the current balance in the account. - - virtual char *name (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Get the name of the <Account> holder. - - virtual void name (const char *name - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Set the name of the <Account> holder. - - virtual void deposit (CORBA::Float - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Deposit money in the account. - - virtual void withdraw (CORBA::Float - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Bank::Account::Overdraft)); - // Withdraw money in the account. - - void orb (CORBA::ORB_ptr o); - // Set the ORB pointer. - -private: - CORBA::ORB_var orb_; - // ORB pointer. - - CORBA::Float balance_; - // balance for this account - - CORBA::String_var name_; - // Name of the <Account> holder. -}; - -#endif /* ACCOUNT_I_H */ diff --git a/TAO/examples/Simple/bank/Bank.idl b/TAO/examples/Simple/bank/Bank.idl deleted file mode 100644 index bcfacbf46e4..00000000000 --- a/TAO/examples/Simple/bank/Bank.idl +++ /dev/null @@ -1,59 +0,0 @@ -// -*- C++ -*- -// $Id$ - -module Bank -{ - // = TITLE - // This module has two interfaces. One represents a bank Account and - // the other is a factory to create the Account Objects. - - interface Account - { - // = TITLE - // This interface represents an account with operations to check - // balance, deposit and withdraw. - - exception Overdraft - { - // = TITLE - // This exception is raised if the client tries to - // withdraw more money than the current balance. - - string reason; - }; - - readonly attribute float balance; - // Attribute to obtain the current <balance>. - - void deposit (in float amount); - // Add <amount> to this account. - - void withdraw (in float amount) raises (Overdraft); - // Withdraw <amount from this account. - - attribute string name; - // The <name> of this account. - }; - - interface AccountManager - { - // = TITLE - // This interface is a factory for the <Account> objects. It has - // operations to create <Account>s and to delete them. - - Account open (in string name, - in float initial_balance); - // Returns the <Account> associated with <name>. If this is the - // first time <name> has been seen, the server will create the - // account. Otherwise, the server will return back an object - // reference to a previously created account. - - void close (in Account account_); - // Close down the account and release its resources if it's the - // last reference to the <account>. Once this call is made it - // is no longer valid to access the <account>. - - void shutdown (); - // This operation shuts down the server. - }; -}; diff --git a/TAO/examples/Simple/bank/Bank_Client_i.cpp b/TAO/examples/Simple/bank/Bank_Client_i.cpp deleted file mode 100644 index a201d196a02..00000000000 --- a/TAO/examples/Simple/bank/Bank_Client_i.cpp +++ /dev/null @@ -1,152 +0,0 @@ -//$Id$ - -#include "Bank_Client_i.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" -#include "ace/OS_NS_unistd.h" - -// This is the interface program that accesses the remote object - -// Constructor. -Bank_Client_i::Bank_Client_i (void) -{ - //no-op -} - -//Destructor. -Bank_Client_i::~Bank_Client_i (void) -{ - //no-op -} - - -int -Bank_Client_i::run (const char *name, - int argc, - char *argv[]) -{ - // Initialize the client. - if (client.init (name,argc, argv) == -1) - return -1; - - ACE_TRY_NEW_ENV - { - this->check_accounts (); - if (client.shutdown () == 1) - client->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_DEBUG ((LM_DEBUG, - "\nException caught in run\n")); - } - ACE_ENDTRY; - - return 0; -} - -int -Bank_Client_i::check_accounts (void ) -{ - ACE_TRY_NEW_ENV - { - ACE_DEBUG ((LM_DEBUG, - "\nTests for account with same name\n")); - this->test_for_same_name (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "\nTests for account with different names\n")); - this->test_for_different_name (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "\nTests for overdrafts\n")); - this->test_for_overdraft (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_DEBUG ((LM_DEBUG, - "From Bank_Client_i::check_accounts()")); - } - ACE_ENDTRY; - return 0; -} - -// This method tests whether an account with a -// a same name can be opened - -void -Bank_Client_i::test_for_same_name (ACE_ENV_SINGLE_ARG_DECL) -{ - - const char *name = "Name"; - CORBA::Float initial_bal = 0.00; - - Bank::Account_var acct_id1 = client->open (name, - initial_bal - ACE_ENV_ARG_PARAMETER); - - Bank::Account_var acct_id2 = client->open (name, - initial_bal - ACE_ENV_ARG_PARAMETER); - - ACE_ASSERT (acct_id1->_is_equivalent ((CORBA::Object *) acct_id2.in ()) != 0); - - client->close (acct_id1.in () - ACE_ENV_ARG_PARAMETER); - - client->close (acct_id2.in () - ACE_ENV_ARG_PARAMETER); -} - -// This method tests whether an account with different names can be opened - -void -Bank_Client_i::test_for_different_name (ACE_ENV_SINGLE_ARG_DECL) -{ - const char *name1 = "Name1"; - const char *name2 = "Name2"; - - CORBA::Float initial_bal = 0.0; - - Bank::Account_var acct_id1 = client->open (name1, - initial_bal - ACE_ENV_ARG_PARAMETER); - - Bank::Account_var acct_id2 = client->open (name2, - initial_bal - ACE_ENV_ARG_PARAMETER); - ACE_ASSERT (acct_id1->_is_equivalent ((CORBA::Object *)acct_id2.in ()) == 0); - - client->close (acct_id1.in () - ACE_ENV_ARG_PARAMETER); - - client->close (acct_id2.in () - ACE_ENV_ARG_PARAMETER); -} - -// This method tests the Overdraft exception. - -void -Bank_Client_i::test_for_overdraft (ACE_ENV_SINGLE_ARG_DECL) -{ - - CORBA::Float initial_bal = 100.0; - const char *name = "Name"; - Bank::Account_var acct_id = client->open (name, initial_bal ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - acct_id->deposit (100.00 ACE_ENV_ARG_PARAMETER); - ACE_CHECK; - - CORBA::Float bal = acct_id->balance (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - acct_id->withdraw (bal + 20); - - client->close (acct_id.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - diff --git a/TAO/examples/Simple/bank/Bank_Client_i.h b/TAO/examples/Simple/bank/Bank_Client_i.h deleted file mode 100644 index 7f1a4084c8c..00000000000 --- a/TAO/examples/Simple/bank/Bank_Client_i.h +++ /dev/null @@ -1,66 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple/bank -// -// = FILENAME -// Bank_Client_i.h -// -// = DESCRIPTION -// This class implements the interface calls for RMI. -// -// = AUTHOR -// -// Balachandran Natarajan <bala@cs.wustl.edu> -// -// ============================================================================ - -#ifndef BANK_CLIENT_I_H -#define BANK_CLIENT_I_H - -#include "../Simple_util.h" -#include "BankC.h" - -class Bank_Client_i -{ - // = TITLE - // Grid_Client interface subclass. - // - // = DESCRIPTION - // This class implements the interface between the interface - // objects and the client . -public: - // = Initialization and termination methods. - Bank_Client_i (void); - // Constructor - - virtual ~Bank_Client_i (void); - // Destructor - - virtual int run (const char *, int, char *[]); - // Execute the methods. - -private: - Client<Bank::AccountManager, Bank::AccountManager_var> client; - // Instantiate the client object. - - int check_accounts (void); - // Method that calls all the test functions - - void test_for_different_name (ACE_ENV_SINGLE_ARG_DECL); - // Tests if accounts opened with different names return a different account - // reference. - - void test_for_same_name (ACE_ENV_SINGLE_ARG_DECL); - // Tests if accounts opened with the same name return the same - // object reference. - - void test_for_overdraft (ACE_ENV_SINGLE_ARG_DECL); - // Tests for the Overdraft Exception when the client tries to - // withdraw more money than the current balance. -}; - -#endif /* TIME_CLIENT_I_H */ diff --git a/TAO/examples/Simple/bank/Makefile.am b/TAO/examples/Simple/bank/Makefile.am deleted file mode 100644 index f18809908cf..00000000000 --- a/TAO/examples/Simple/bank/Makefile.am +++ /dev/null @@ -1,119 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.bank_IDL.am - -BUILT_SOURCES = \ - BankC.cpp \ - BankC.h \ - BankC.inl \ - BankS.cpp \ - BankS.h \ - BankS.inl - -CLEANFILES = \ - Bank-stamp \ - BankC.cpp \ - BankC.h \ - BankC.inl \ - BankS.cpp \ - BankS.h \ - BankS.inl - -BankC.cpp BankC.h BankC.inl BankS.cpp BankS.h BankS.inl: Bank-stamp - -Bank-stamp: $(srcdir)/Bank.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) $(srcdir)/Bank.idl - @touch $@ - - -noinst_HEADERS = \ - Bank.idl - -## Makefile.bank_client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -client_SOURCES = \ - ../Simple_util.cpp \ - BankC.cpp \ - Bank_Client_i.cpp \ - client.cpp \ - ../Simple_util.h \ - Bank_Client_i.h - -client_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.bank_server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -server_SOURCES = \ - ../Simple_util.cpp \ - AccountManager_i.cpp \ - Account_i.cpp \ - BankC.cpp \ - BankS.cpp \ - server.cpp \ - ../Simple_util.h \ - AccountManager_i.h \ - Account_i.h - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/Simple/bank/README b/TAO/examples/Simple/bank/README deleted file mode 100644 index 7fc2d09e31e..00000000000 --- a/TAO/examples/Simple/bank/README +++ /dev/null @@ -1,114 +0,0 @@ -$Id$ - -This is a simple CORBA example that has a module Bank with two -interfaces Account and AccountManager. The Account interface has -operations for balance, deposit and withdraw. It has a readonly -attribute for the Account Holder's name. It also has a user defined -exception which is raised for withdrawing more moneythen the current -balance. The AccountManager interface has methods to create and close -Accounts. It also has a method to shutdown the server. - -run_test.pl : This is a perl script to run the server and client as : ------------- - server -o ior_file - client -f ior_file - -Passing the Server IOR to Clients: ---------------------------------- - -To keep this example simple, the server advertises its IOR in the -following manner - The server program writes its server object's IOR -to a ior_file. Later on, the client reads this IOR from the specified -ior_file and uses the <string_to_object> method to obtain a reference -to the server object. - -For this mechanism to work, the file must be readable and writable. If -it doesn't exist, a new file is created by the server. Moreover, the -file path must be accessible to both the client and server. - -If the client and server are on different machine, then there must be -a shared directory accessible by both. On UNIX system's this is -typically done via the NFS mount command. On Windows, the 'explorer' -application provides an option to share drives. - -In general if no such file sharing option is available, then using the -the Naming Service mechanism is the only alternative, as described by -the -n option below. There are other command line options available -for the server and client which are also explained below. - -server: -------- - -server [-d] [-o IOR_file_name] [-n] - -Options: -------- --d Debug flag (It is additive more -d flags will give debugging). - -When the server is started, you should see as the first line of output -something that looks like - iiop:1.0//danzon.cs.wustl.edu:10015/P35ad159600081a38/child_poa/server - (-ORBobjrefstyle url) -or - IOR:000000000000001649444c3a43756269745... - (-ORBobjrefstyle ior) - -Using -d turns on debugging messages. This option is additive, i.e., -the more -d options provided, the more debugging you can get. At the -moment, only 2 levels of debugging are implemented, and more than 2 -d -options are ignored. - --o This option creates an ior file for the server with the name ior_filename. --n Use naming service - -The file can be used by clients who wish to access the server directly -using this ior file. This obviates the need for the client to use the -naming service for getting the server ior. The client can use the -f -option to specify the file which contains the ior of the server (the -same file that was written by the server using the -o option). - -client: -------- - -client [-d] [-x] [-n iterations] [-b initial_balance] [-o Name_of_account_holder] - [-f IOR_file_name ] [-k IOR] - -Options: -------- --d Debug flag - --x Tells the server to shutdown at the end of the test. - --n Use naming service - --b initial balance - --o Name of the Account Holder - --k Read IOR from the command line. If this option is specified the client does not use - the Naming Service for locating the server. It just uses the ior file supplied with - this option. - --f Read IOR from the specified file. If this option is specified the client does not use - the Naming Service for locating the server. It just uses the ior file supplied with - this option. - -The client executes the following tests : - -1. Creating accounts with the same name to make sure the Account is - created only once and he gets back the same object reference each - time. This is confirmed by the server printing the message for - Creation of an account only once. - -2. Creating accounts with different name to make sure a different - Account is created and a different IOR returned each time. - -3. Creating an Account with some initial balance and then withdrawing - more than the current balance. The server throws an exception which is - passed to the client and the client displays the reason for the - exception. - - - - - diff --git a/TAO/examples/Simple/bank/bank.mpc b/TAO/examples/Simple/bank/bank.mpc deleted file mode 100644 index df8debec262..00000000000 --- a/TAO/examples/Simple/bank/bank.mpc +++ /dev/null @@ -1,37 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*IDL): taoidldefaults, anytypecode { - IDL_Files { - Bank.idl - } - custom_only = 1 -} - -project(*server): namingexe, iortable, utils { - exename = server - after += *IDL - Source_Files { - Account_i.cpp - AccountManager_i.cpp - ../Simple_util.cpp - server.cpp - BankS.cpp - BankC.cpp - } - IDL_Files { - } -} - -project(*client): namingexe, iortable, utils { - exename = client - after += *IDL - Source_Files { - BankC.cpp - client.cpp - ../Simple_util.cpp - Bank_Client_i.cpp - } - IDL_Files { - } -} diff --git a/TAO/examples/Simple/bank/client.cpp b/TAO/examples/Simple/bank/client.cpp deleted file mode 100644 index 0f426992f06..00000000000 --- a/TAO/examples/Simple/bank/client.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -# include "Bank_Client_i.h" - -// The client program for the application. - -int -main (int argc, char **argv) -{ - Bank_Client_i client; - - - ACE_DEBUG ((LM_DEBUG, - "\nBank client\n\n")); - - if (client.run ("Bank",argc, argv) == -1) - return -1; - else - return 0; - -} - - diff --git a/TAO/examples/Simple/bank/run_test.pl b/TAO/examples/Simple/bank/run_test.pl deleted file mode 100755 index ad99091c941..00000000000 --- a/TAO/examples/Simple/bank/run_test.pl +++ /dev/null @@ -1,44 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "../../../../bin"; -use PerlACE::Run_Test; - -$status = 0; - -$iorfile = PerlACE::LocalFile ("bank.ior"); - -unlink $iorfile; - -$SV = new PerlACE::Process ("server", "-o $iorfile"); -$CL = new PerlACE::Process ("client", "-f $iorfile"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { - print STDERR "ERROR: Could not find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->TerminateWaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/examples/Simple/bank/server.cpp b/TAO/examples/Simple/bank/server.cpp deleted file mode 100644 index 57ded2b1063..00000000000 --- a/TAO/examples/Simple/bank/server.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ -#include "../Simple_util.h" -#include "AccountManager_i.h" - -// This is the main driver program for the time and date server. - -int -main (int argc, char *argv[]) -{ - Server<AccountManager_i> server; - - ACE_DEBUG ((LM_DEBUG, - "\n\tBank server\n\n")); - - ACE_TRY_NEW_ENV - { - if (server.init ("Bank", - argc, - argv - ACE_ENV_ARG_PARAMETER) == -1) - return 1; - else - { - server.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::UserException, userex) - { - ACE_PRINT_EXCEPTION (userex,"User Exception"); - return -1; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - ACE_PRINT_EXCEPTION (sysex,"System Exception"); - return -1; - } - - ACE_ENDTRY; - - return 0; -} - diff --git a/TAO/examples/Simple/chat/Broadcaster.idl b/TAO/examples/Simple/chat/Broadcaster.idl deleted file mode 100644 index 2704650fb74..00000000000 --- a/TAO/examples/Simple/chat/Broadcaster.idl +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#include "Receiver.idl" - -interface Broadcaster -{ - // = TITLE - // This interface is to be implemented by the simple chat server. - // It broadcasts messages received from one registered client to - // all its registered clients. - - exception CannotAdd - { - string reason_; - }; - - exception CannotRemove - { - string reason_; - }; - - void add (in Receiver receiver_, in string nickname) - raises (CannotAdd); - // Registers a Receiver with the chat server. A registered client - // must call un_register before it goes away. - - void remove (in Receiver receiver_) - raises (CannotRemove); - // Unregisters a Receiver. - - void say (in Receiver receiver_, in string text); - // Say something to all registered clients. -}; diff --git a/TAO/examples/Simple/chat/Broadcaster_i.cpp b/TAO/examples/Simple/chat/Broadcaster_i.cpp deleted file mode 100644 index 6aee1874901..00000000000 --- a/TAO/examples/Simple/chat/Broadcaster_i.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Broadcaster_i.cpp -// -// = DESCRIPTION -// Implementation of the Broadcaster_i class. This class is the servant -// object for the chat server. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#include "Broadcaster_i.h" - -bool -Broadcaster_i::Receiver_Data::operator == (const Broadcaster_i::Receiver_Data &receiver_data) const -{ - // The <_is_equivalent> function checks if the _var and _ptr objects - // are the same. NOTE: this call might not behave well on other - // ORBs since <_is_equivalent> isn't guaranteed to differentiate - // object references. - return - this->receiver_->_is_equivalent (receiver_data.receiver_.in ()) - && this->nickname_ == receiver_data.nickname_; -} - -Broadcaster_i::Broadcaster_i (void) -{ - // No-op -} - -Broadcaster_i::~Broadcaster_i (void) -{ - // No-op -} - -void -Broadcaster_i::add (Receiver_ptr receiver, - const char *nickname - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - Broadcaster::CannotAdd - )) -{ - Broadcaster_i::Receiver_Data receiver_data; - - // Store the client information. - receiver_data.receiver_ = Receiver::_duplicate (receiver); - receiver_data.nickname_ = nickname; - - // Insert the Receiver reference to the set - if (receiver_set_.insert (receiver_data) == -1) - ACE_THROW (Broadcaster::CannotAdd ("failed to add to the receiver set\n")); - - // Tell everyone which person just joined the chat. - ACE_CString broadcast_string = - ACE_CString ("**** ") - + ACE_CString (nickname) - + ACE_CString (" has joined the chat ****\n"); - - ACE_TRY - { - this->broadcast (broadcast_string.fast_rep () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Broadcaster_i::broadcast failed.\t\n"); - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -Broadcaster_i::remove (Receiver_ptr receiver - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - Broadcaster::CannotRemove - )) -{ - Broadcaster_i::Receiver_Data receiver_data_to_remove; - - // Go through the list of <Receiver_Data> to find which registered client - // wants to be removed. - for (RECEIVER_SET_ITERATOR iter = this->receiver_set_.begin (); - iter != this->receiver_set_.end (); - iter++) - { - // The <_is_equivalent> function checks if the _var and _ptr objects - // are the same. NOTE: this call might not behave well on other - // ORBs since <_is_equivalent> isn't guaranteed to differentiate - // object references. - if ((*iter).receiver_.in ()->_is_equivalent (receiver) == 1) - { - receiver_data_to_remove = *iter; - break; - } - } - - // Remove the reference from our list. - if (this->receiver_set_.remove (receiver_data_to_remove) == -1) - ACE_THROW(Broadcaster::CannotRemove ("failed to remove from receiver set\n")); - - // Tell everyone, which person left the chat. - ACE_CString broadcast_string = "**** " - + receiver_data_to_remove.nickname_ - + " left the chat" - + " ****\n"; - - this->broadcast (broadcast_string.fast_rep () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; -} - -void -Broadcaster_i::say (Receiver_ptr receiver, - const char *text - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - ACE_TRY - { - ACE_CString sender_nickname ("Sender Unknown"); - - // Find the nickname for this receiver. - - for (RECEIVER_SET_ITERATOR iter = this->receiver_set_.begin (); - iter != this->receiver_set_.end (); - iter++) - { - // The <_is_equivalent> function checks if the _var and - // _ptr objects are the same. NOTE: this call might not - // behave well on other ORBs since <_is_equivalent> isn't - // guaranteed to differentiate object references. - if ((*iter).receiver_.in ()->_is_equivalent (receiver) == 1) - sender_nickname = (*iter).nickname_; - } - - // Broadcast the message to all registered clients - ACE_CString broadcast_string ("[" + sender_nickname + "] " + text); - - this->broadcast (broadcast_string.fast_rep () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Broadcaster_i::say\t\n"); - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -Broadcaster_i::broadcast (const char *text - ACE_ENV_ARG_DECL) -{ - // Broadcast the message to all registered clients. - - for (RECEIVER_SET_ITERATOR iter = this->receiver_set_.begin (); - iter != this->receiver_set_.end (); - iter++) - { - ACE_TRY - { - (*iter).receiver_->message (text - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"Failed to send a message\n"); - } - ACE_ENDTRY; - ACE_CHECK; - } -} - diff --git a/TAO/examples/Simple/chat/Broadcaster_i.h b/TAO/examples/Simple/chat/Broadcaster_i.h deleted file mode 100644 index 666f8ab66c7..00000000000 --- a/TAO/examples/Simple/chat/Broadcaster_i.h +++ /dev/null @@ -1,107 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Broadcaster_i.h -// -// = DESCRIPTION -// Defines the implementation header for the Broadcaster interface. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#ifndef BROADCASTER_I_H -#define BROADCASTER_I_H - -#include "BroadcasterS.h" -#include "ReceiverC.h" -#include "tao/Utils/ORB_Manager.h" -#include "ace/Containers.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "ace/SString.h" - -class Broadcaster_i : public POA_Broadcaster -{ - // = TITLE - // The implementation of the Broadcaster class, which is the - // servant object for the chat server. -public: - // = Initialization and termination methods. - Broadcaster_i (void); - // Constructor. - - ~Broadcaster_i (void); - // Destructor. - - virtual void add (Receiver_ptr receiver, - const char *nickname - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - Broadcaster::CannotAdd - )); - // Saves receiver references in a list. - - virtual void remove (Receiver_ptr receiver - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - Broadcaster::CannotRemove - )); - // Removes receiver references from the list. - - virtual void say (Receiver_ptr receiver, - const char *text - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - // Called by Broadcaster clients to send messages. - -public: - TAO_ORB_Manager orb_manager_; - // The ORB manager. - - void broadcast (const char* text - ACE_ENV_ARG_DECL); - // Broadcasts the text to all registered clients. - - class Receiver_Data - { - // = TITLE - // Per-client info. - // - // = DESCRIPTION - // Saves the Receiver_var and user nickname. - public: - bool operator == (const Receiver_Data &receiver_data) const; - // The == op required by the ACE_Unbounded set. - - Receiver_var receiver_; - // Stores the receiver reference. - - ACE_CString nickname_; - // Stores the client nickname. - }; - - typedef ACE_Unbounded_Set<Receiver_Data> - RECEIVER_SET; - typedef ACE_Unbounded_Set_Iterator<Receiver_Data> - RECEIVER_SET_ITERATOR; - - RECEIVER_SET receiver_set_; - // Set of registered clients. -}; - -#endif /* BROADCASTER_I_H */ diff --git a/TAO/examples/Simple/chat/Client_i.cpp b/TAO/examples/Simple/chat/Client_i.cpp deleted file mode 100644 index 268da16eaeb..00000000000 --- a/TAO/examples/Simple/chat/Client_i.cpp +++ /dev/null @@ -1,257 +0,0 @@ -// $Id$ - -// =========================================================== -// -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Client_i.cpp -// -// = DESCRIPTION -// Implementation of the Client_i class. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#include "Client_i.h" -#include "tao/ORB.h" -#include "tao/ORB_Core.h" -#include "ace/Read_Buffer.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_fcntl.h" -#include "ace/OS_NS_unistd.h" - -Client_i::Client_i () - : ior_file_name_ ("chat.ior"), - nickname_ ("noname") -{ -} - -Client_i::~Client_i (void) -{ - // Make sure to cleanup the STDIN handler. - if (ACE_Event_Handler::remove_stdin_handler - (TAO_ORB_Core_instance ()->reactor (), - TAO_ORB_Core_instance ()->thr_mgr ()) == -1) - ACE_ERROR ((LM_ERROR, - "%p\n", - "remove_stdin_handler")); -} - -int -Client_i::parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "n:f:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'n': // get the users nickname - this->nickname_ = get_opts.opt_arg (); - break; - - case 'f': // get the file name to write to - this->ior_file_name_ = get_opts.opt_arg (); - break; - - default: // display help for use of the serve - case '?': // display help for use of the server. - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-n <your_nick_name>]" - " [-f <ior_input_file>]" - "\n", - argv [0]), - -1); - } - - ACE_DEBUG ((LM_DEBUG, - "\nusing nickname = %s, filename = %s\n", - this->nickname_, - this->ior_file_name_)); - return 0; -} - -int -Client_i::init (int argc, char *argv[]) -{ - // Check if the command line arguments are ok. - if (this->parse_args (argc, argv) == -1) - return -1; - - ACE_TRY_NEW_ENV - { - // Retrieve the ORB. - this->orb_manager_.init (argc, - argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::ORB_var orb = this->orb_manager_.orb (); - - // set the orb in the receiver_i_ object. - this->receiver_i_.orb (orb.in ()); - - // read the ior from file - if (this->read_ior (this->ior_file_name_) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "could not read the ior from the file: <%s>\n", - this->ior_file_name_), - -1); - - CORBA::Object_var server_object = - orb->string_to_object (this->ior_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (server_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - "invalid ior <%s>\n", - this->ior_), - -1); - - this->server_ = Broadcaster::_narrow (server_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "client_i::init\n"); - return -1; - } - ACE_ENDTRY; - - // Register our <Input_Handler> to handle STDIN events, which will - // trigger the <handle_input> method to process these events. - - if (ACE_Event_Handler::register_stdin_handler - (this, - TAO_ORB_Core_instance ()->reactor (), - TAO_ORB_Core_instance ()->thr_mgr ()) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "register_stdin_handler"), - -1); - return 0; -} - -int -Client_i::run (void) -{ - ACE_DEBUG ((LM_DEBUG, - "\n============= Simple Chat =================\n" - "========== type 'quit' to exit ===========\n")); - - ACE_TRY_NEW_ENV - { - PortableServer::POAManager_var poa_manager = - this->orb_manager_.poa_manager (); - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->receiver_var_ = - this->receiver_i_._this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Register ourselves with the server. - server_->add (this->receiver_var_.in (), - this->nickname_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Run the ORB. - this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Client_i::run ()"); - return -1; - } - ACE_ENDTRY; - - return 0; -} - -int -Client_i::handle_input (ACE_HANDLE) -{ - char buf[BUFSIZ]; - - if (ACE_OS::fgets (buf, BUFSIZ, stdin) == 0) - return 0; - - ACE_TRY_NEW_ENV - { - // Check if the user wants to quit. - if (ACE_OS::strncmp (buf, - QUIT_STRING, - ACE_OS::strlen (QUIT_STRING)) == 0) - { - // Remove ourselves from the server. - this->server_->remove (this->receiver_var_.in ()); - this->receiver_i_.shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - - ACE_TRY_CHECK; - return 0; - } - - // Call the server function <say> to pass the string typed by - // the server. - this->server_->say (this->receiver_var_.in (), - buf - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Input_Handler::init"); - return -1; - } - ACE_ENDTRY; - - return 0; -} - -int -Client_i::read_ior (const char *filename) -{ - // Open the file for reading. - ACE_HANDLE f_handle = ACE_OS::open (filename, 0); - - if (f_handle == ACE_INVALID_HANDLE) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - filename, - "invalid handle"), - -1); - - ACE_Read_Buffer ior_buffer (f_handle); - char *data = ior_buffer.read (); - - if (data == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to read ior: %p\n"), - -1); - - this->ior_ = ACE_OS::strdup (data); - ior_buffer.alloc ()->free (data); - - ACE_OS::close (f_handle); - - if (this->ior_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "failed to read ior from file\n", - ""), - -1); - return 0; -} diff --git a/TAO/examples/Simple/chat/Client_i.h b/TAO/examples/Simple/chat/Client_i.h deleted file mode 100644 index b42c0514823..00000000000 --- a/TAO/examples/Simple/chat/Client_i.h +++ /dev/null @@ -1,95 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// =========================================================== -// -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Client_i.h -// -// = DESCRIPTION -// Definition of the Chat Client class, Client_i. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#ifndef CLIENT_I_H -#define CLIENT_I_H - -#include "Receiver_i.h" -#include "BroadcasterC.h" -#include "ace/Read_Buffer.h" -#include "ace/Event_Handler.h" -#include "ace/SString.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Utils/ORB_Manager.h" - -class Client_i : public ACE_Event_Handler -{ - // = TITLE - // Chat Client class. - // - // = DESCRIPTION - // Connects to the Chat server and registers the Receiver_i - // object with the chat server. It also takes in user chat - // messages and sends them to the server. -public: - // = Initialization and termination methods. - Client_i (void); - // Constructor. - - ~Client_i (void); - // Destructor. - - int init (int argc, char *argv[]); - // Initialize the client communication with the server. - - int run (void); - // Start the ORB object. - - virtual int handle_input (ACE_HANDLE); - // Handle the user input. - - private: - int parse_args (int argc, char *argv[]); - // Parse the command line arguments. - // Returns 0 on success, -1 on error. - - int read_ior (const char *filename); - // Function to read the server ior from a file. - - char *ior_; - // IOR of the obj ref of the server. - - const char* ior_file_name_; - // The filename that stores the ior of the server - - const char* nickname_; - // Nickname of the user chatting. - - TAO_ORB_Manager orb_manager_; - // Our orb. - - Broadcaster_var server_; - // Server object ptr. - - Receiver_i receiver_i_; - // The receiver object. - - Receiver_var receiver_var_; - // Pointer to the receiver object registered with the ORB. -}; - -#define QUIT_STRING "quit" -// The string that the user must type to quit the chat. - -#endif /* CLIENT_I_H */ diff --git a/TAO/examples/Simple/chat/Makefile.am b/TAO/examples/Simple/chat/Makefile.am deleted file mode 100644 index 1a569319962..00000000000 --- a/TAO/examples/Simple/chat/Makefile.am +++ /dev/null @@ -1,137 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.chat_IDL.am - -BUILT_SOURCES = \ - ReceiverC.cpp \ - ReceiverC.h \ - ReceiverC.inl \ - ReceiverS.cpp \ - ReceiverS.h \ - ReceiverS.inl - -CLEANFILES = \ - Receiver-stamp \ - ReceiverC.cpp \ - ReceiverC.h \ - ReceiverC.inl \ - ReceiverS.cpp \ - ReceiverS.h \ - ReceiverS.inl - -ReceiverC.cpp ReceiverC.h ReceiverC.inl ReceiverS.cpp ReceiverS.h ReceiverS.inl: Receiver-stamp - -Receiver-stamp: $(srcdir)/Receiver.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Receiver.idl - @touch $@ - -BUILT_SOURCES += \ - BroadcasterC.cpp \ - BroadcasterC.h \ - BroadcasterC.inl \ - BroadcasterS.cpp \ - BroadcasterS.h \ - BroadcasterS.inl - -CLEANFILES += \ - Broadcaster-stamp \ - BroadcasterC.cpp \ - BroadcasterC.h \ - BroadcasterC.inl \ - BroadcasterS.cpp \ - BroadcasterS.h \ - BroadcasterS.inl - -BroadcasterC.cpp BroadcasterC.h BroadcasterC.inl BroadcasterS.cpp BroadcasterS.h BroadcasterS.inl: Broadcaster-stamp - -Broadcaster-stamp: $(srcdir)/Broadcaster.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Broadcaster.idl - @touch $@ - - -noinst_HEADERS = \ - Broadcaster.idl \ - Receiver.idl - -## Makefile.chat_client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) - -client_SOURCES = \ - BroadcasterC.cpp \ - Client_i.cpp \ - ReceiverC.cpp \ - ReceiverS.cpp \ - Receiver_i.cpp \ - client.cpp \ - Client_i.h \ - Receiver_i.h - -client_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.chat_server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) - -server_SOURCES = \ - BroadcasterC.cpp \ - BroadcasterS.cpp \ - Broadcaster_i.cpp \ - ReceiverC.cpp \ - Server_i.cpp \ - server.cpp \ - Broadcaster_i.h \ - Server_i.h - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/Simple/chat/README b/TAO/examples/Simple/chat/README deleted file mode 100644 index 5a7eeeb4764..00000000000 --- a/TAO/examples/Simple/chat/README +++ /dev/null @@ -1,97 +0,0 @@ -$Id$ - -This is a simple chat application that uses the TAO CORBA ORB. It -consists of a client and server programs. The server broadcasts -messages from one client to all the clients registered with it. The -client(s) register with a running server. It has a very simple user -interface that accepts strings from the user and sends it across to -the server. The client code also demonstrates the use of the -ACE_Event_Handlerclass to accept user input events. - -server: -------- - -server [-o <ior_output_file>] - -Options: -------- --o Outputs the server ior to the file specified. - -On successfull initialization, the server displays a message that it -is running and waits for clients to register with it. If the [-o -<ior_output_file>] option is not specified on the command line then -the the server will write the IOR of the server CORBA object to a -default file - "chat.ior". - -Passing the Server IOR to Clients: ---------------------------------- - -To keep this example simple, the server advertises its IOR in the -following manner - The server program writes its server object's IOR -to a ior_file. Later on, the client reads this IOR from the specified -ior_file and uses the <string_to_object> method to obtain a reference -to the server object. - -For this mechanism to work, the file must be readable and writable. If -it doesn't exist, a new file is created by the server. Moreover, the -file path must be accessible to both the client and server. - -If the client and server are on different machine, then there must be -a shared directory accessible by both. On UNIX system's this is -typically done via the NFS mount command. On Windows, the 'explorer' -application provides an option to share drives. - -In general if no such file sharing option is available, then using the -the Naming Service mechanism is the only alternative. To preserve its -simplicity, this example does not provide the feature to use a Naming -Service. An example of such a use is $TAO_ROOT/examples/Event_Comm/. - -client: -------- - -client [-n <your_nick_name> -f <ior_input_file>] - -Options: -------- --n The nickname that the chat user wants to use. --f Reads the server ior from the file - -The nickname specified by the user is displayed by the chat server to -all the clients. To quit the chat, type "quit". - -If the [-f <ior_input_file>] option is not specified on the command -line then the client will attempt to read the IOR of the server CORBA -object from the default file - "chat.ior". - -VxWorks -------- -On VxWorks, it's easiest to run the client without any command -line options. That way, its stdin can be captured: - - -> ld < server - value = 400826292 = 0x17e41fb4 - -> spa main - value = 0 = 0x0 - Running chat server... - -> ld < client - value = 399329360 = 0x17cd4850 - -> main - - using defaults. nickname = noname, filename = chat.ior - - ============= Simple Chat ================= - ========== type 'quit' to exit =========== - : **** noname has joined the chat **** - - hello - : [noname] hello - - goodbye - : [noname] goodbye - - quit - value = 0 = 0x0 - -NOTE: if you built your VxWorks executables with g++, replace "main" -with "ace_main" above. See ACE-INSTALL.html for an explanation of why -ACE renames "main" to "ace_main" with g++ on VxWorks. diff --git a/TAO/examples/Simple/chat/Receiver.idl b/TAO/examples/Simple/chat/Receiver.idl deleted file mode 100644 index 90ea6570071..00000000000 --- a/TAO/examples/Simple/chat/Receiver.idl +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -interface Receiver -{ - // = TITLE - // The Receiver interface is implemented by the simple chat - // clients.The interface functions are called by the chat server. - - void message (in string msg); - // Displays the message in the client application. - - oneway void shutdown (); - // Called by the chat server before it goes away. -}; diff --git a/TAO/examples/Simple/chat/Receiver_i.cpp b/TAO/examples/Simple/chat/Receiver_i.cpp deleted file mode 100644 index ac2ba71f635..00000000000 --- a/TAO/examples/Simple/chat/Receiver_i.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Receiver_i.cpp -// -// = DESCRIPTION -// Implements the Receiver_i class, which is used by the chat client. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#include "Receiver_i.h" - -Receiver_i::Receiver_i (void) - : orb_ (0) -{ -} - -Receiver_i::~Receiver_i (void) -{ -} - -void -Receiver_i::message (const char *msg - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - ACE_DEBUG ((LM_DEBUG, - ": %s\n", - msg)); -} - -void -Receiver_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC (( - CORBA::SystemException - )) -{ - // Instruct the ORB to shutdown. - this->orb_->shutdown (); -} - -void -Receiver_i::orb (CORBA::ORB_ptr o) -{ - this->orb_ = CORBA::ORB::_duplicate (o); -} diff --git a/TAO/examples/Simple/chat/Receiver_i.h b/TAO/examples/Simple/chat/Receiver_i.h deleted file mode 100644 index 7c3a0767517..00000000000 --- a/TAO/examples/Simple/chat/Receiver_i.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Receiver_i.h -// -// = DESCRIPTION -// Defines the implementation header for the Receiver interface. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#ifndef RECEIVER_I_H -#define RECEIVER_I_H - -#include "ReceiverS.h" - -class Receiver_i : public POA_Receiver -{ - // = TITLE - // Receiver object implementation - // - // = DESCRIPTION - // This class has methods that are called by the chat server. -public: - // = Initialization and termination methods. - Receiver_i (void); - // Constructor. - - ~Receiver_i (void); - // Destructor. - - virtual void message (const char *msg - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - // Receives a message string. - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException - )); - // Called when the chat server is going away. The client - // implementation should shutdown the chat client in response to - // this. - - void orb (CORBA::ORB_ptr o); - // Set the ORB pointer. - -private: - CORBA::ORB_var orb_; - // ORB pointer. -}; - -#endif /* RECEIVER_I_H */ diff --git a/TAO/examples/Simple/chat/Server.h b/TAO/examples/Simple/chat/Server.h deleted file mode 100644 index 4d47a8bf73d..00000000000 --- a/TAO/examples/Simple/chat/Server.h +++ /dev/null @@ -1,18 +0,0 @@ -// $Id$ - -// =========================================================== -// -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Server.h -// -// = DESCRIPTION -// Definition of the Server class for the chat. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== diff --git a/TAO/examples/Simple/chat/Server_i.cpp b/TAO/examples/Simple/chat/Server_i.cpp deleted file mode 100644 index 208a440ad86..00000000000 --- a/TAO/examples/Simple/chat/Server_i.cpp +++ /dev/null @@ -1,123 +0,0 @@ -// $Id$ - -// =========================================================== -// -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Server_i.cpp -// -// = DESCRIPTION -// Implementation of the Chat Server_i class. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#include "Server_i.h" -#include "ace/Get_Opt.h" -#include "ace/OS_NS_stdio.h" - -Server_i::Server_i () - : ior_file_name_ ("chat.ior") -{ - // No Op. -} - -Server_i::~Server_i (void) -{ - // NO Op. -} - -int -Server_i::parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "o:"); - int c; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'o': // get the file name to write to - this->ior_file_name_ = get_opts.opt_arg (); - break; - - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-o] <ior_output_file>" - "\n", - argv [0]), - -1); - } - - return 0; -} - -int -Server_i::init (int argc, - char *argv[] - ACE_ENV_ARG_DECL) -{ - // Parse the command line options. - if (this-> parse_args(argc, argv) == -1) - return -1; - - if (this->orb_manager_.init (argc, - argv - ACE_ENV_ARG_PARAMETER) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "%p\n", - "orb manager init failed\n"), - -1); - ACE_CHECK_RETURN (-1); - - CORBA::ORB_var orb = this->orb_manager_.orb (); - - // Activate the servant. - CORBA::String_var str = - this->orb_manager_.activate (&this->broadcaster_i_ - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - - // Write the IOR to a file. - this->write_IOR (str.in ()); - return 0; -} - -int -Server_i::run (ACE_ENV_SINGLE_ARG_DECL) -{ - ACE_DEBUG ((LM_DEBUG, - "Running chat server...\n")); - - // Run the main event loop for the ORB. - int ret = this->orb_manager_.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (-1); - if (ret == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "Server_i::run"), - -1); - return 0; -} - -int -Server_i::write_IOR(const char* ior) -{ - FILE* ior_output_file_ = - ACE_OS::fopen (this->ior_file_name_, "w"); - - if (ior_output_file_) - { - ACE_OS::fprintf (ior_output_file_, - "%s", - ior); - ACE_OS::fclose (ior_output_file_); - } - - return 0; -} diff --git a/TAO/examples/Simple/chat/Server_i.h b/TAO/examples/Simple/chat/Server_i.h deleted file mode 100644 index 03fdd200b37..00000000000 --- a/TAO/examples/Simple/chat/Server_i.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -// =========================================================== -// -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// Server_i.h -// -// = DESCRIPTION -// Definition of the Chat Server_i class. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#ifndef SERVER_I_H -#define SERVER_I_H - -#include "Broadcaster_i.h" -#include "tao/Utils/ORB_Manager.h" - -class Server_i -{ - // = TITLE - // The class defines the server for the chat. It sets up the Orb - // manager and registers the Broadcaster servant object. - -public: - // = Initialization and termination methods. - Server_i (void); - // Constructor. - - ~Server_i (void); - // Destructor. - - int init (int argc, - char *argv[] - ACE_ENV_ARG_DECL); - // Initialize the server. - - int run (ACE_ENV_SINGLE_ARG_DECL); - // Run the ORB. - -private: - int parse_args (int argc, char *argv[]); - // Parses the command line arguments. - - int write_IOR (const char *ior); - // Writes the server ior to a file, for the clients to pick up - // later. - - const char *ior_file_name_; - // The file name to save the ior to. - - TAO_ORB_Manager orb_manager_; - // The tao orb manager object. - - Broadcaster_i broadcaster_i_; - // The servant object registered with the orb. -}; - -#endif /* SERVER_I_H */ diff --git a/TAO/examples/Simple/chat/chat.mpc b/TAO/examples/Simple/chat/chat.mpc deleted file mode 100644 index 5b3a353ea50..00000000000 --- a/TAO/examples/Simple/chat/chat.mpc +++ /dev/null @@ -1,38 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*IDL): taoidldefaults { - IDL_Files { - Receiver.idl - Broadcaster.idl - } - custom_only = 1 -} - -project(*server) : taoserver, utils, iortable { - after += *IDL - IDL_Files { - } - Source_Files { - Broadcaster_i.cpp - Server_i.cpp - server.cpp - BroadcasterS.cpp - BroadcasterC.cpp - ReceiverC.cpp - } -} - -project(*client): taoexe, portableserver, utils { - after += *IDL - IDL_Files { - } - Source_Files { - Receiver_i.cpp - Client_i.cpp - client.cpp - ReceiverS.cpp - ReceiverC.cpp - BroadcasterC.cpp - } -} diff --git a/TAO/examples/Simple/chat/client.cpp b/TAO/examples/Simple/chat/client.cpp deleted file mode 100644 index 7caf6e595a0..00000000000 --- a/TAO/examples/Simple/chat/client.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ - -// =========================================================== -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// client.cpp -// -// = DESCRIPTION -// The Chat client program entry point. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#include "Client_i.h" - -int -main (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - Client_i client_i; - - if (client_i.init (argc, argv) == -1 - || client_i.run () == -1) - return -1; - - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "client::main\t\n"); - return -1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/examples/Simple/chat/server.cpp b/TAO/examples/Simple/chat/server.cpp deleted file mode 100644 index 66937b85a2e..00000000000 --- a/TAO/examples/Simple/chat/server.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// $Id$ - -// =========================================================== -// -// -// = LIBRARY -// TAO/tests/Simple/chat -// -// = FILENAME -// server.cpp -// -// = DESCRIPTION -// Entry point for the chat server. -// -// = AUTHOR -// Pradeep Gore <pradeep@cs.wustl.edu> -// -// =========================================================== - -#include "Server_i.h" - -int -main (int argc, char *argv[]) -{ - - ACE_TRY_NEW_ENV - { - Server_i server_i; - - int ret = server_i.init (argc, argv ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - if (ret != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "\n error in init.\n"), - 1); - ret = server_i.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - if (ret != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "\n error in run.\n"), - 1); - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "server::main\t\n"); - return 1; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/examples/Simple/echo/Echo.idl b/TAO/examples/Simple/echo/Echo.idl deleted file mode 100644 index a396838f0bb..00000000000 --- a/TAO/examples/Simple/echo/Echo.idl +++ /dev/null @@ -1,27 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -#if !defined (_ECHO_IDL) -#define _ECHO_IDL - -interface Echo -{ - // = TITLE - // Defines an interface that encapsulates operations that return the - // mesg string to be displayed and shuts down the server. - - typedef sequence<Object> List; - - List echo_list (in string message); - // This operation returns the message as a sequence of Objects and - // displays it on the screen as a string. - - string echo_string (in string message); - // This operation returns the message as a string and displays it on - // the screen. - - oneway void shutdown (); - // This operation will shutdown the server. -}; - -#endif /* _ECHO_IDL */ diff --git a/TAO/examples/Simple/echo/Echo_Client_i.cpp b/TAO/examples/Simple/echo/Echo_Client_i.cpp deleted file mode 100644 index 67088738cf4..00000000000 --- a/TAO/examples/Simple/echo/Echo_Client_i.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//$Id$ - -#include "Echo_Client_i.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" -#include "ace/OS_NS_unistd.h" - -// This is the interface program that accesses the remote object - -// Constructor. -Echo_Client_i::Echo_Client_i (void) -{ - //no-op -} - -//Destructor. -Echo_Client_i::~Echo_Client_i (void) -{ - //no-op -} - -int -Echo_Client_i::run (const char *name, - int argc, - char *argv[]) -{ - // Initialize the client. - if (client.init (name,argc, argv) == -1) - return -1; - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - while (1) - { - char buf[BUFSIZ]; - - // Get the input message which has to be displayed. - ACE_DEBUG ((LM_DEBUG, - "ECHO? ")); - - if (ACE_OS::fgets (buf,sizeof buf, stdin) == 0) - break; - - CORBA::String_var s = client->echo_string (buf - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "\nString echoed by client \n%s\n", - s.in ())); - } - - if (client.shutdown () == 1) - client->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - - ACE_TRY_CHECK; - - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,"\n Exception in RMI"); - return -1; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - return 0; -} - diff --git a/TAO/examples/Simple/echo/Echo_Client_i.h b/TAO/examples/Simple/echo/Echo_Client_i.h deleted file mode 100644 index c26927826a7..00000000000 --- a/TAO/examples/Simple/echo/Echo_Client_i.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple/echo -// -// = FILENAME -// Echo_Client_i.h -// -// = DESCRIPTION -// This class implements the interface calls for RMI. -// -// = AUTHOR -// -// Balachandran Natarajan <bala@cs.wustl.edu> -// -// ============================================================================ - -#ifndef ECHO_CLIENT_I_H -#define ECHO_CLIENT_I_H - -#include "../Simple_util.h" -#include "EchoC.h" - -class Echo_Client_i -{ - // = TITLE - // Echo_Client interface subclass. - // - // = DESCRIPTION - // This class implements the interface between the interface - // objects and the client . -public: - // = Initialization and termination methods. - Echo_Client_i (void); - // Constructor - - virtual ~Echo_Client_i (void); - // Destructor - - virtual int run (const char *, int, char **); - // Execute the methods - -private: - Client<Echo, Echo_var> client; - // Instantiate the client object. -}; - -#endif /* TIME_CLIENT_I_H */ diff --git a/TAO/examples/Simple/echo/Echo_i.cpp b/TAO/examples/Simple/echo/Echo_i.cpp deleted file mode 100644 index aeef101e78d..00000000000 --- a/TAO/examples/Simple/echo/Echo_i.cpp +++ /dev/null @@ -1,106 +0,0 @@ -// $Id$ - -#include "Echo_i.h" - -ACE_RCSID(Echo, Echo_i, "$Id$") - -// Constructor. - -Echo_i::Echo_i (void) -{ -} - -// Destructor. - -Echo_i::~Echo_i (void) -{ -} - -// Set the ORB pointer. - -void -Echo_i::orb (CORBA::ORB_ptr o) -{ - this->orb_ = CORBA::ORB::_duplicate (o); -} - -// Return a list of object references. - -Echo::List * -Echo_i::echo_list (const char * - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Echo::List_var list; - - { - Echo::List *tmp = 0; - ACE_NEW_RETURN (tmp, - Echo::List (3), - 0); - // Pass ownership to the _var, pitty that ACE_NEW_RETURN cannot - // assign to T_vars directly. - list = tmp; - } - - list->length (3); - - // Just do something to get a list of object references. - list[CORBA::ULong(0)] = - orb_->resolve_initial_references ("NameService" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - list[CORBA::ULong(1)] = - orb_->resolve_initial_references ("NameService" - ACE_ENV_ARG_PARAMETER);; - ACE_CHECK_RETURN (0); - - list[CORBA::ULong(2)] = - orb_->resolve_initial_references ("NameService" - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - return list._retn (); -} - -// Return the mesg string from the server - -char * -Echo_i::echo_string (const char *mesg - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // The pointer mesg was NULL, return. - if (mesg == 0) - return 0; - - CORBA::String_var str = CORBA::string_dup (mesg); - - // if <CORBA::string_dup> returns a 0 pointer, an exception is - // raised. - - if (str.in () == 0) - ACE_THROW_RETURN (CORBA::NO_MEMORY (), 0); - - // Got thru! now, make a deep copy of the mesg string and send it - // back to the client. - - return str._retn (); - // The _retn is used as it allows the conversion of - // CORBA::String_var to char* without causing any compiler errors. -} - -// Shutdown the server application. - -void -Echo_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "\n%s\n", - "The echo server is shutting down")); - - // Instruct the ORB to shutdown. - this->orb_->shutdown (); -} diff --git a/TAO/examples/Simple/echo/Echo_i.h b/TAO/examples/Simple/echo/Echo_i.h deleted file mode 100644 index 1b782cce796..00000000000 --- a/TAO/examples/Simple/echo/Echo_i.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple/echo -// -// = FILENAME -// Echo_i.h -// -// = DESCRIPTION -// This class implements the Echo IDL interface. -// -// = AUTHOR -// Kirthika Parameswaran <kirthika@cs.wustl.edu> -// -// ============================================================================ - -#ifndef ECHO_I_H -#define ECHO_I_H - -#include "EchoS.h" - -class Echo_i : public POA_Echo -{ - // = TITLE - // Echo Object Implementation - // - // = DESCRIPTION - // The object implementation performs teh following functions: - // -- To return the string which needs to be displayed - // from the server. - // -- shuts down the server -public: - // = Initialization and termination methods. - Echo_i (void); - // Constructor. - - ~Echo_i (void); - // Destructor. - - virtual Echo::List *echo_list (const char *mesg - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Return the mesg string back from the server. - - virtual char *echo_string (const char *mesg - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Return the mesg string back from the server. - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Shutdown the server. - - void orb (CORBA::ORB_ptr o); - // Set the ORB pointer. - -private: - CORBA::ORB_var orb_; - // ORB pointer. - - ACE_UNIMPLEMENTED_FUNC (void operator= (const Echo_i&)) - // Keeping g++ 2.7.2 happy.. -}; - -#endif /* ECHO_I_H */ diff --git a/TAO/examples/Simple/echo/Makefile.am b/TAO/examples/Simple/echo/Makefile.am deleted file mode 100644 index f712ee97a2c..00000000000 --- a/TAO/examples/Simple/echo/Makefile.am +++ /dev/null @@ -1,117 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.echo_IDL.am - -BUILT_SOURCES = \ - EchoC.cpp \ - EchoC.h \ - EchoC.inl \ - EchoS.cpp \ - EchoS.h \ - EchoS.inl - -CLEANFILES = \ - Echo-stamp \ - EchoC.cpp \ - EchoC.h \ - EchoC.inl \ - EchoS.cpp \ - EchoS.h \ - EchoS.inl - -EchoC.cpp EchoC.h EchoC.inl EchoS.cpp EchoS.h EchoS.inl: Echo-stamp - -Echo-stamp: $(srcdir)/Echo.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Echo.idl - @touch $@ - - -noinst_HEADERS = \ - Echo.idl - -## Makefile.echo_client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -client_SOURCES = \ - ../Simple_util.cpp \ - EchoC.cpp \ - Echo_Client_i.cpp \ - client.cpp \ - ../Simple_util.h \ - Echo_Client_i.h - -client_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.echo_server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -server_SOURCES = \ - ../Simple_util.cpp \ - EchoC.cpp \ - EchoS.cpp \ - Echo_i.cpp \ - server.cpp \ - ../Simple_util.h \ - Echo_i.h - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/Simple/echo/README b/TAO/examples/Simple/echo/README deleted file mode 100644 index 0420d5d5833..00000000000 --- a/TAO/examples/Simple/echo/README +++ /dev/null @@ -1,82 +0,0 @@ -$Id$ - -This is a simple CORBA example that has an object (Echo) with only two -methods, one that returns the message to be displayed and another that -shuts down the server. - -run_test.pl : This is a perl script to run the server and client as : ------------- - server -o ior_file - client -f ior_file - -This perl script runs the server and client and shuts down the server -when it is done. - -Passing the Server IOR to Clients: ---------------------------------- - -To keep this example simple, the server advertises its IOR in the -following manner - The server program writes its server object's IOR -to a ior_file. Later on, the client reads this IOR from the specified -ior_file and uses the <string_to_object> method to obtain a reference -to the server object. - -For this mechanism to work, the file must be readable and writable. If -it doesn't exist, a new file is created by the server. Moreover, the -file path must be accessible to both the client and server. - -If the client and server are on different machine, then there must be -a shared directory accessible by both. On UNIX system's this is -typically done via the NFS mount command. On Windows, the 'explorer' -application provides an option to share drives. - -In general if no such file sharing option is available, then using the -the Naming Service mechanism is the only alternative, as described by -the -n option below. - -server: -------- - -server [-d] [-o <ior_output_file>] [-n] - -Options: -------- --d Debug flag (It is additive more -d flags will give debugging). --o Outputs the ior to the file - The ior is the reference using which the client can interact with - the target server object. --n Use the naming service - -When the server is started, you should see as the first line of output -something that looks like - - iiop:1.0//danzon.cs.wustl.edu:10015/P35ad159600081a38/child_poa/server - (-ORBobjrefstyle url) -or - IOR:000000000000001649444c3a43756269745... - (-ORBobjrefstyle ior) - -Using -d turns on debugging messages. This option is additive, i.e., -the more -d options provided, the more debugging you can get. At the -moment, only 2 levels of debugging are implemented, and more than 2 -d -options are ignored. - -client: -------- - -client [-d] [-x] [-f <Server_ior_file>] [-k ior] [-n naming service] - -Options: -------- --d Debug flag --x Tells the server to shutdown at the end of the test. --f Reads the server ior from the file --k IOR or The IOR can also be given in the format like file://[file.ior] - with the full path - --n Use the naming service - -You can either cut and paste the IOR from the server to the client -(with the -k option), have the client read the IOR from a file using -the -f option (this file is produced using the -o option of the -server), or use the naming service (with the -n option). diff --git a/TAO/examples/Simple/echo/client.cpp b/TAO/examples/Simple/echo/client.cpp deleted file mode 100644 index f2aa863069b..00000000000 --- a/TAO/examples/Simple/echo/client.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//$Id$ - -# include "Echo_Client_i.h" - -// The client program for the application. - -int -main (int argc, char **argv) -{ - Echo_Client_i client; - - - ACE_DEBUG ((LM_DEBUG, - "\nEcho client\n\n")); - - if (client.run ("Echo", - argc, - argv) == -1) - return -1; - else - return 0; - -} - - diff --git a/TAO/examples/Simple/echo/echo.mpc b/TAO/examples/Simple/echo/echo.mpc deleted file mode 100644 index bf60819c91b..00000000000 --- a/TAO/examples/Simple/echo/echo.mpc +++ /dev/null @@ -1,36 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*IDL): taoidldefaults { - IDL_Files { - Echo.idl - } - custom_only = 1 -} - -project(*server): namingexe, iortable, utils { - exename = server - after += *IDL - Source_Files { - Echo_i.cpp - ../Simple_util.cpp - server.cpp - EchoS.cpp - EchoC.cpp - } - IDL_Files { - } -} - -project(*client): namingexe, iortable, utils { - exename = client - after += *IDL - Source_Files { - Echo_Client_i.cpp - ../Simple_util.cpp - client.cpp - EchoC.cpp - } - IDL_Files { - } -} diff --git a/TAO/examples/Simple/echo/run_test.pl b/TAO/examples/Simple/echo/run_test.pl deleted file mode 100755 index f8a88e36242..00000000000 --- a/TAO/examples/Simple/echo/run_test.pl +++ /dev/null @@ -1,44 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "../../../../bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = PerlACE::LocalFile ("echo.ior"); - -unlink $iorfile; - -$SV = new PerlACE::Process ("server", "-o $iorfile"); -$CL = new PerlACE::Process ("client", "-f $iorfile -x"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { - print STDERR "ERROR: Could not find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; - diff --git a/TAO/examples/Simple/echo/server.cpp b/TAO/examples/Simple/echo/server.cpp deleted file mode 100644 index b74d5bc7af6..00000000000 --- a/TAO/examples/Simple/echo/server.cpp +++ /dev/null @@ -1,45 +0,0 @@ -// $Id$ -#include "../Simple_util.h" -#include "Echo_i.h" - -// This is the main driver program for the time and date server. - -int -main (int argc, char *argv[]) -{ - Server<Echo_i> server; - - ACE_DEBUG ((LM_DEBUG, - "\n\tEcho server\n\n")); - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - if (server.init ("Echo", - argc, - argv - ACE_ENV_ARG_PARAMETER) == -1) - return 1; - else - { - server.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::UserException, userex) - { - ACE_PRINT_EXCEPTION (userex,"User Exception"); - return -1; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - ACE_PRINT_EXCEPTION (sysex, "System Exception"); - return -1; - } - - ACE_ENDTRY; - - return 0; -} - diff --git a/TAO/examples/Simple/fullname/README b/TAO/examples/Simple/fullname/README deleted file mode 100644 index ec922a86286..00000000000 --- a/TAO/examples/Simple/fullname/README +++ /dev/null @@ -1,3 +0,0 @@ -This is a simple example that would take the first name and the last -name of a person and return the full name of the individual through -the "out" argument in the operation signature of the IDL. diff --git a/TAO/examples/Simple/grid/Grid.idl b/TAO/examples/Simple/grid/Grid.idl deleted file mode 100644 index e857b7f9238..00000000000 --- a/TAO/examples/Simple/grid/Grid.idl +++ /dev/null @@ -1,52 +0,0 @@ -// -*- C++ -*- -// $Id$ - -interface Grid -{ - // = TITLE - // Create a <Grid> of type <name> - - attribute short height; - // Height of the grid. - - attribute short width; - // Width of the grid. - - exception RANGE_ERROR - { - // = TITLE - // The range of parameter values do not fall in the expected - // range. - }; - - // = Constants for LOCATIONS and VALUE. - const short DEFAULT_LOCATION = 1; - const short DEFAULT_VALUE = 100; - - void set (in short n, in short m, in long value) - raises (RANGE_ERROR); - // Set the element [n,m] of the grid, to value. - - long get (in short n, in short m) - raises (RANGE_ERROR); - // Return element [n,m] of the grid. - - void destroy (); - // Destroy the grid. -}; - -interface Grid_Factory -{ - // = TITLE - // Factory that creates a <Grid> - - // = Default height and width for a <Grid>. - const short DEFAULT_HEIGHT = 10; - const short DEFAULT_WIDTH = 10; - - Grid make_grid (in short height, in short width); - // Returns a new <Grid> instance. - - void shutdown (); - // Shutdown the application. -}; diff --git a/TAO/examples/Simple/grid/Grid_Client_i.cpp b/TAO/examples/Simple/grid/Grid_Client_i.cpp deleted file mode 100644 index d333682c8dd..00000000000 --- a/TAO/examples/Simple/grid/Grid_Client_i.cpp +++ /dev/null @@ -1,137 +0,0 @@ -//$Id$ - -#include "Grid_Client_i.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" -#include "ace/streams.h" -#include "ace/OS_NS_unistd.h" - -// This is the interface program that accesses the remote object - -// Constructor. -Grid_Client_i::Grid_Client_i (void) - : height_ (0), - width_ (0), - setx_ (0), - sety_ (0), - value_ (0) - -{ - //no-op -} - -//Destructor. -Grid_Client_i::~Grid_Client_i (void) -{ - ACE_DEBUG ((LM_DEBUG, "Called \n")); - //no-op -} - -int -Grid_Client_i::parse_args (int argc, - char *argv[]) -{ - // Parses some of the options that are specific to this example - ACE_Get_Opt get_opts (argc, argv, "df:nk:xw:h:p:q:v:"); - - int c = 0; - while ((c = get_opts ()) != -1) - switch (c) - { - case 'p': // A horizontal position of the grid where - // the value is stored - setx_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ()); - break; - case 'q': // A vertical position of the grid where a - // value is stored - sety_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ()); - break; - case 'w': - width_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ()); - break; - case 'h': - height_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ()); - break; - case 'v': - value_ = (u_int) ACE_OS::atoi (get_opts.opt_arg ()); - break; - } - - if (setx_ == 0 ) - setx_ = Grid::DEFAULT_LOCATION; - if (sety_ == 0 ) - sety_ = Grid::DEFAULT_LOCATION; - if (value_ == 0 ) - value_ = Grid::DEFAULT_VALUE; - return 0; -} - -int -Grid_Client_i::run (const char *name, - int argc, - char *argv[]) -{ - // Initialize the client. - if (client.init (name, argc, argv) == -1) - return -1; - - if (this->parse_args (argc, argv) == -1) - return -1; - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - // Make the Grid. - - Grid_var grid = client->make_grid (width_, - height_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Made the grid succesfully\n")); - - // Set a value on the grid - grid->set (setx_, - sety_, - value_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Setting a value for the grid\n")); - - CORBA::Long ret_val = grid->get (setx_, - sety_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_ASSERT (ret_val == value_); - - if (client.shutdown () == 1) { - client->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - - client.orb ()->destroy (); - ACE_UNUSED_ARG (ret_val); - } - ACE_CATCH (CORBA::UserException, range_ex) - { - ACE_PRINT_EXCEPTION (range_ex, - "\tFrom get and set grid"); - return -1; - } - ACE_CATCH (CORBA::SystemException, memex) - { - ACE_PRINT_EXCEPTION (memex, - "Cannot make grid as Memory exhausted"); - return -1; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - return 0; -} - diff --git a/TAO/examples/Simple/grid/Grid_Client_i.h b/TAO/examples/Simple/grid/Grid_Client_i.h deleted file mode 100644 index cf4cc4336b3..00000000000 --- a/TAO/examples/Simple/grid/Grid_Client_i.h +++ /dev/null @@ -1,68 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/Simple/grid -// -// = FILENAME -// Grid_Client_i.h -// -// = DESCRIPTION -// This class implements the interface calls for RMI. -// -// = AUTHOR -// Balachandran Natarajan <bala@cs.wustl.edu> -// -// ============================================================================ - -#ifndef GRID_CLIENT_I_H -#define GRID_CLIENT_I_H - -#include "../Simple_util.h" -#include "GridC.h" - -class Grid_Client_i -{ - // = TITLE - // Grid_Client interface subclass. - // - // = DESCRIPTION - // This class implements the interface between the interface - // objects and the client . -public: - // = Initialization and termination methods. - Grid_Client_i (void); - // Constructor - - virtual ~Grid_Client_i (void); - // Destructor - - virtual int run (const char *, int, char *[]); - // Execute the methods. - - virtual int parse_args (int argc, char *argv[]); - // Parses the command line arguments. - -private: - Client<Grid_Factory, Grid_Factory_var> client; - // Instantiate the client object. - - CORBA::Short height_; - // Height of the grid. - - CORBA::Short width_; - // Width of the grid. - - CORBA::Short setx_; - // Cell identifier in which a value meeds to be stored. - - CORBA::Short sety_; - // Cell identifier in which a value meeds to be stored. - - CORBA::Long value_; - // The value that needs to be stored in the cell. -}; - -#endif /* TIME_CLIENT_I_H */ diff --git a/TAO/examples/Simple/grid/Grid_i.cpp b/TAO/examples/Simple/grid/Grid_i.cpp deleted file mode 100644 index 8a320540b28..00000000000 --- a/TAO/examples/Simple/grid/Grid_i.cpp +++ /dev/null @@ -1,203 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#include "Grid_i.h" - -// Default constructor. - -Grid_i::Grid_i (void) - : width_ (0), - height_ (0), - array_ (0) -{ - //no-op -} - -// Constructor. - -Grid_i::Grid_i (CORBA::Short x, - CORBA::Short y - ACE_ENV_ARG_DECL) - : width_ (x), - height_ (y) -{ - ACE_NEW_THROW_EX (array_, - CORBA::Long *[y], - CORBA::NO_MEMORY ()); - ACE_CHECK; - - // Allocate memory for the matrix. - - for (int ctr = 0; ctr < y; ctr++) - { - ACE_NEW_THROW_EX (array_[ctr], - CORBA::Long[x], - CORBA::NO_MEMORY ()); - ACE_CHECK; - } - -} - -// Default destructor. - -Grid_i::~Grid_i (void) -{ - // no-op. -} - -// Set a value in the grid. - -void -Grid_i::set (CORBA::Short x, - CORBA::Short y, - CORBA::Long value - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Grid::RANGE_ERROR)) -{ - if (x < 0 - || y < 0 - || x >= width_ - || y >= height_) - ACE_THROW (Grid::RANGE_ERROR ()); - else - array_[x][y] = value; -} - -// Get a value from the grid. - -CORBA::Long -Grid_i::get (CORBA::Short x, - CORBA::Short y - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException, - Grid::RANGE_ERROR)) -{ - if (x < 0 - || y < 0 - || x >= width_ - || y >= height_) - ACE_THROW_RETURN (Grid::RANGE_ERROR (), -1); - else - return array_[x][y]; -} - -// Access methods. - -CORBA::Short -Grid_i::width (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->width_; -} - -CORBA::Short -Grid_i::height (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return this->height_; -} - -void -Grid_i::width (CORBA::Short x - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->width_ = x; -} - -void -Grid_i::height (CORBA::Short y - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - this->height_ = y; -} - -// Destroy the grid - -void -Grid_i::destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - // Delete the array. - - for (int i = 0; i < height_; i++) - delete [] array_[i]; - - delete [] array_; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) %s\n", - "Grid has been destroyed")); -} - -// Set the ORB pointer. - -void -Grid_Factory_i::orb (CORBA::ORB_ptr o) -{ - this->orb_ = CORBA::ORB::_duplicate (o); -} - -// Shutdown. - -void -Grid_Factory_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) %s\n", - "Grid Factory is shutting down")); - - // Instruct the ORB to shutdown. - this->orb_->shutdown (); -} - -// Constructor - -Grid_Factory_i::Grid_Factory_i (void) -{ - // no-op -} - -// Destructor - -Grid_Factory_i::~Grid_Factory_i (void) -{ - // no-op -} - -// Make a <Grid>. - -Grid_ptr -Grid_Factory_i::make_grid (CORBA::Short width, - CORBA::Short height - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - Grid_i *grid_ptr = 0; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Making a new Grid\n")); - - // Set a default value for width. - if (width <= 0) - width = Grid_Factory::DEFAULT_WIDTH; - - // Set a default value for height. - if (height <= 0) - height = Grid_Factory::DEFAULT_HEIGHT; - - // This attempts to create a new Grid_i and throws an exception and - // returns a null value if it fails - ACE_NEW_THROW_EX (grid_ptr, - Grid_i (width, height ACE_ENV_ARG_PARAMETER), - CORBA::NO_MEMORY ()); - ACE_CHECK_RETURN (Grid::_nil ()); - - // Register the Grid pointer. - Grid_ptr gptr = grid_ptr->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - return gptr; -} diff --git a/TAO/examples/Simple/grid/Grid_i.h b/TAO/examples/Simple/grid/Grid_i.h deleted file mode 100644 index 77f08452574..00000000000 --- a/TAO/examples/Simple/grid/Grid_i.h +++ /dev/null @@ -1,127 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/Simple/grid -// -// = FILENAME -// Grid_i.h -// -// = DESCRIPTION -// This class implements the Grid IDL interface. -// -// = AUTHOR -// -// ============================================================================ - -#ifndef GRID_I_H -#define GRID_I_H - -#include "GridS.h" - -class Grid_i: public POA_Grid -{ - // = TITLE - // Grid object implementation. - // - // = DESCRIPTION - // Grid object implementation -public: - // = Initialization and termination methods. - - Grid_i (void); - // Constructor - - Grid_i (CORBA::Short, - CORBA::Short - ACE_ENV_ARG_DECL_NOT_USED); - // Constructor. - - ~Grid_i (void); - // Destructor - - virtual CORBA::Short width (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Returns the width of the grid - - virtual CORBA::Short height (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Returns the height of the grid - - virtual void width (CORBA::Short - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Sets the width of the grid. - - virtual void height (CORBA::Short - ACE_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 - ACE_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 - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException, - Grid::RANGE_ERROR)); - // Gets the grid value. - - virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Destroy the grid. - -private: - CORBA::Short width_; - // Width of the grid. - - CORBA::Short height_; - // Height of the grid. - - CORBA::Long **array_; - // Pointer to the matrix. This is organized as an "array of arrays." -}; - -class Grid_Factory_i : public POA_Grid_Factory -{ - // =TITLE - // Create a <Grid>. -public: - // = Initialization and termination methods. - Grid_Factory_i (void); - // Constructor. - - ~Grid_Factory_i (void); - // Destructor. - - virtual Grid_ptr make_grid (CORBA::Short, - CORBA::Short - ACE_ENV_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // This function creates and returns a <Grid>. - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Shutdown the server. - - void orb (CORBA::ORB_ptr o); - // Set the ORB pointer. - -private: - CORBA::ORB_var orb_; - // ORB pointer. - - ACE_UNIMPLEMENTED_FUNC (void operator= (const Grid_Factory_i &)) - // Keeping g++2.7.2 -}; - -#endif /* GRID_I_H */ diff --git a/TAO/examples/Simple/grid/Makefile.am b/TAO/examples/Simple/grid/Makefile.am deleted file mode 100644 index 3e50df86814..00000000000 --- a/TAO/examples/Simple/grid/Makefile.am +++ /dev/null @@ -1,117 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.grid_IDL.am - -BUILT_SOURCES = \ - GridC.cpp \ - GridC.h \ - GridC.inl \ - GridS.cpp \ - GridS.h \ - GridS.inl - -CLEANFILES = \ - Grid-stamp \ - GridC.cpp \ - GridC.h \ - GridC.inl \ - GridS.cpp \ - GridS.h \ - GridS.inl - -GridC.cpp GridC.h GridC.inl GridS.cpp GridS.h GridS.inl: Grid-stamp - -Grid-stamp: $(srcdir)/Grid.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Grid.idl - @touch $@ - - -noinst_HEADERS = \ - Grid.idl - -## Makefile.grid_client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -client_SOURCES = \ - ../Simple_util.cpp \ - GridC.cpp \ - Grid_Client_i.cpp \ - client.cpp \ - ../Simple_util.h \ - Grid_Client_i.h - -client_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.grid_server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -server_SOURCES = \ - ../Simple_util.cpp \ - GridC.cpp \ - GridS.cpp \ - Grid_i.cpp \ - server.cpp \ - ../Simple_util.h \ - Grid_i.h - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/Simple/grid/README b/TAO/examples/Simple/grid/README deleted file mode 100644 index 1df1f4f70ae..00000000000 --- a/TAO/examples/Simple/grid/README +++ /dev/null @@ -1,94 +0,0 @@ -$Id$ - -This is a simple CORBA example that makes a grid of user defined size. -The grid can be imagined as a matrix with cells that can hold values. -This example creates a simple grid server with user defined sizes. If -the user does not define the size a default grid is created. The user -can give a value to be held in the grid. - -run_test.pl : This is a perl script to run the server and client as : ------------- - server -o ior_file - client -f ior_file - -This perl script runs the server and client and shuts down the server -when it is done. - -Passing the Server IOR to Clients: ---------------------------------- - -To keep this example simple, the server advertises its IOR in the -following manner - The server program writes its server object's IOR -to a ior_file. Later on, the client reads this IOR from the specified -ior_file and uses the <string_to_object> method to obtain a reference -to the server object. - -For this mechanism to work, the file must be readable and writable. If -it doesn't exist, a new file is created by the server. Moreover, the -file path must be accessible to both the client and server. - -If the client and server are on different machine, then there must be -a shared directory accessible by both. On UNIX system's this is -typically done via the NFS mount command. On Windows, the 'explorer' -application provides an option to share drives. - -In general if no such file sharing option is available, then using the -the Naming Service mechanism is the only alternative, as described by -the -n option below. - -server: -------- - -server [-d] [-o <ior_output_file>] [-n] - -Options: -------- --d Debug flag (It is additive more -d flags will give debugging). --o Outputs the ior to the file - The ior is the reference using which the client can interact with - the target server object. --n Use the naming service - -When the server is started, you should see as the first line of output -something that looks like - - iiop:1.0//danzon.cs.wustl.edu:10015/P35ad159600081a38/child_poa/server - (-ORBobjrefstyle url) -or - IOR:000000000000001649444c3a43756269745... - (-ORBobjrefstyle ior) - -Using -d turns on debugging messages. This option is additive, i.e., -the more -d options provided, the more debugging you can get. At the -moment, only 2 levels of debugging are implemented, and more than 2 -d -options are ignored. - -client: -------- - -client [-d] [-x] [-f <Server_ior_file>] [-n iterations] [-k ior] [-n] [-p] - [-q] [-w] [-h] [-v] - -Options: -------- --d Debug flag --x Tells the server to shutdown at the end of the test. --f Reads the server ior from the file --n no. of iterations --k IOR or The IOR can also be given in the format like file://[file.ior] - with the full path --n Use the naming service --p A horizontal position of the grid where the value [v] is stored --q A vertical position of the grid where the value [v] is stored --w Width of the grid --h Height of the grid --v Value that needs to be stored in the grid. - -The last four options ie. p,q,w,h,v have default values. So, if the client -is invoked without these options then default values of one or all are -taken. - -You can either cut and paste the IOR from the server to the client -(with the -k option), have the client read the IOR from a file using -the -f option (this file is produced using the -o option of the -server), or use the naming service (with the -s option). diff --git a/TAO/examples/Simple/grid/client.cpp b/TAO/examples/Simple/grid/client.cpp deleted file mode 100644 index 4bec0e49dad..00000000000 --- a/TAO/examples/Simple/grid/client.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// $Id$ - -# include "Grid_Client_i.h" - -// The client program for the application. - -int -main (int argc, char *argv[]) -{ - Grid_Client_i client; - - - ACE_DEBUG ((LM_DEBUG, - "\nGrid client\n\n")); - - if (client.run ("Grid", argc, argv) == -1) - return -1; - else - return 0; - -} - - diff --git a/TAO/examples/Simple/grid/grid.mpc b/TAO/examples/Simple/grid/grid.mpc deleted file mode 100644 index 2bdacb54e58..00000000000 --- a/TAO/examples/Simple/grid/grid.mpc +++ /dev/null @@ -1,36 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*IDL): taoidldefaults { - IDL_Files { - Grid.idl - } - custom_only = 1 -} - -project(*server): namingexe, iortable, utils { - exename = server - after += *IDL - Source_Files { - Grid_i.cpp - server.cpp - ../Simple_util.cpp - GridS.cpp - GridC.cpp - } - IDL_Files { - } -} - -project(*client): namingexe, iortable, utils { - exename = client - after += *IDL - Source_Files { - client.cpp - ../Simple_util.cpp - Grid_Client_i.cpp - GridC.cpp - } - IDL_Files { - } -} diff --git a/TAO/examples/Simple/grid/run_test.pl b/TAO/examples/Simple/grid/run_test.pl deleted file mode 100755 index 949f8b42585..00000000000 --- a/TAO/examples/Simple/grid/run_test.pl +++ /dev/null @@ -1,43 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "../../../../bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = PerlACE::LocalFile ("grid.ior"); - -unlink $iorfile; - -$SV = new PerlACE::Process ("server", "-o $iorfile"); -$CL = new PerlACE::Process ("client", "-f $iorfile -x -w 12 -h 12 -p 2 -q 2 -v 2345"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 15) == -1) { - print STDERR "ERROR: Could not find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/examples/Simple/grid/server.cpp b/TAO/examples/Simple/grid/server.cpp deleted file mode 100644 index 6e95c17f2b5..00000000000 --- a/TAO/examples/Simple/grid/server.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// $Id$ -#include "../Simple_util.h" -#include "Grid_i.h" - -// This is the main driver program for the time and date server. - -int -main (int argc, char *argv[]) -{ - Server<Grid_Factory_i> server; - - ACE_DEBUG ((LM_DEBUG, - "\n\tGrid server\n\n")); - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - if (server.init ("Grid", - argc, - argv - ACE_ENV_ARG_PARAMETER) == -1) - return 1; - else - { - server.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::UserException, userex) - { - //ACE_UNUSED_ARG (userex); - ACE_PRINT_EXCEPTION (userex, "User Exception in main"); - return -1; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - //ACE_UNUSED_ARG (sysex); - ACE_PRINT_EXCEPTION (sysex, "System Exception in main "); - return -1; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - return 0; -} - diff --git a/TAO/examples/Simple/squareit/README b/TAO/examples/Simple/squareit/README deleted file mode 100644 index b88331e80f5..00000000000 --- a/TAO/examples/Simple/squareit/README +++ /dev/null @@ -1,2 +0,0 @@ -This is a simple example that would take a number and return the -square of the number through the same argument.
\ No newline at end of file diff --git a/TAO/examples/Simple/time-date/Alt_Resource_Factory.h b/TAO/examples/Simple/time-date/Alt_Resource_Factory.h deleted file mode 100644 index 34bcb27cebf..00000000000 --- a/TAO/examples/Simple/time-date/Alt_Resource_Factory.h +++ /dev/null @@ -1,46 +0,0 @@ -// $Id$ - -// Definition for Win32 Export directives. -// This file is generated automatically by -// ${ACE_ROOT}/GenExportH.BAT -// ------------------------------ -#ifndef Alt_Resource_Factory_EXPORT_H -#define Alt_Resource_Factory_EXPORT_H - -#include "ace/config-all.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#if defined (TAO_AS_STATIC_LIBS) -# if !defined (Alt_Resource_Factory_HAS_DLL) -# define Alt_Resource_Factory_HAS_DLL 0 -# endif /* ! Alt_Resource_Factory_HAS_DLL */ -#else -# if !defined (Alt_Resource_Factory_HAS_DLL) -# define Alt_Resource_Factory_HAS_DLL 1 -# endif /* ! Alt_Resource_Factory_HAS_DLL */ -#endif - -#if defined (Alt_Resource_Factory_HAS_DLL) -# if (Alt_Resource_Factory_HAS_DLL == 1) -# if defined (Alt_Resource_Factory_BUILD_DLL) -# define Alt_Resource_Factory_Export ACE_Proper_Export_Flag -# define Alt_Resource_Factory_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) -# else -# define Alt_Resource_Factory_Export ACE_Proper_Import_Flag -# define Alt_Resource_Factory_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) -# endif /* Alt_Resource_Factory_BUILD_DLL */ -# else -# define Alt_Resource_Factory_Export -# define Alt_Resource_Factory_SINGLETON_DECLARATION(T) -# endif /* ! Alt_Resource_Factory_HAS_DLL == 1 */ -#else -# define Alt_Resource_Factory_Export -# define Alt_Resource_Factory_SINGLETON_DECLARATION(T) -#endif /* Alt_Resource_Factory_HAS_DLL */ - -#endif /* Alt_Resource_Factory_EXPORT_H */ - -// End of auto generated file. diff --git a/TAO/examples/Simple/time-date/Makefile.am b/TAO/examples/Simple/time-date/Makefile.am deleted file mode 100644 index b31689cf4fa..00000000000 --- a/TAO/examples/Simple/time-date/Makefile.am +++ /dev/null @@ -1,120 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.Simple_Time_Date_Lib.am - -BUILT_SOURCES = \ - Time_DateC.cpp \ - Time_DateC.h \ - Time_DateC.inl \ - Time_DateS.cpp \ - Time_DateS.h \ - Time_DateS.inl - -CLEANFILES = \ - Time_Date-stamp \ - Time_DateC.cpp \ - Time_DateC.h \ - Time_DateC.inl \ - Time_DateS.cpp \ - Time_DateS.h \ - Time_DateS.inl - -Time_DateC.cpp Time_DateC.h Time_DateC.inl Time_DateS.cpp Time_DateS.h Time_DateS.inl: Time_Date-stamp - -Time_Date-stamp: $(srcdir)/Time_Date.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -Wb,export_macro=Alt_Resource_Factory_Export -Wb,export_include=Alt_Resource_Factory.h $(srcdir)/Time_Date.idl - @touch $@ - -noinst_LTLIBRARIES = libTime_Date.la - -libTime_Date_la_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -DACE_BUILD_SVC_DLL \ - -DAlt_Resource_Factory_BUILD_DLL - -libTime_Date_la_SOURCES = \ - Time_Date.cpp \ - Time_DateC.cpp \ - Time_DateS.cpp \ - Time_Date_i.cpp - -noinst_HEADERS = \ - Alt_Resource_Factory.h \ - Time_Date.idl \ - Time_DateC.h \ - Time_DateC.inl \ - Time_DateS.h \ - Time_DateS.inl \ - Time_Date_i.h - -## Makefile.Simple_Time_Date_Client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -client_SOURCES = \ - Time_Date_Client_i.cpp \ - client.cpp \ - Time_Date_Client_i.h - -client_LDADD = \ - libTime_Date.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.Simple_Time_Date_Server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) - -server_SOURCES = \ - server.cpp - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/Simple/time-date/README b/TAO/examples/Simple/time-date/README deleted file mode 100644 index 829cd17a504..00000000000 --- a/TAO/examples/Simple/time-date/README +++ /dev/null @@ -1,11 +0,0 @@ -$Id$ - -This example illustrates how to dynamically link an ORB and servants -into an application via the ACE Service Configurator. It also -illustrates a simple Time & Date class. - -run_test.pl: ------------- - -This perl script runs the server and client and shuts down the server -when it is done. diff --git a/TAO/examples/Simple/time-date/Simple_time_date.mpc b/TAO/examples/Simple/time-date/Simple_time_date.mpc deleted file mode 100644 index 7eaefad4fc4..00000000000 --- a/TAO/examples/Simple/time-date/Simple_time_date.mpc +++ /dev/null @@ -1,39 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*lib): portableserver, taolib_with_idl { - sharedname = Time_Date - // The svc conf files assume that the dll is in the current directory - libout = . - idlflags += -Wb,export_macro=Alt_Resource_Factory_Export -Wb,export_include=Alt_Resource_Factory.h - dynamicflags += ACE_BUILD_SVC_DLL Alt_Resource_Factory_BUILD_DLL - Source_Files { - Time_Date.cpp - Time_Date_i.cpp - } - Header_Files { - Alt_Resource_Factory.h - } -} - -project(*server): taoserver { - IDL_Files { - } - Source_Files { - server.cpp - } - header_files { - } -} - -project(*client): taoclient, iortable, namingexe, portableserver { - after += *lib - libs += Time_Date - libpaths += . - Source_Files { - client.cpp - Time_Date_Client_i.cpp - } - IDL_Files { - } -} diff --git a/TAO/examples/Simple/time-date/Time_Date.cpp b/TAO/examples/Simple/time-date/Time_Date.cpp deleted file mode 100644 index 78bd1de184d..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date.cpp +++ /dev/null @@ -1,232 +0,0 @@ -// $Id$ - -#ifndef ACE_BUILD_SVC_DLL -# define ACE_BUILD_SVC_DLL -#endif - -#ifndef Alt_Resource_Factory_BUILD_DLL -# define Alt_Resource_Factory_BUILD_DLL -#endif - -#include "Time_Date_i.h" - -#include "Time_Date.h" -#include "tao/TAO_Singleton_Manager.h" -#include "tao/debug.h" -#include "ace/Reactor.h" -#include "ace/Get_Opt.h" -#include "ace/Dynamic_Service.h" - - -ACE_Reactor * -My_Resource_Factory::get_reactor (void) -{ -#if defined (ACE_HAS_THREADS) - // Use whatever the default is if we've got threads. - return TAO_Default_Resource_Factory::get_reactor (); -#else - // Just use the Singleton Reactor. - return ACE_Reactor::instance (); -#endif /* ACE_HAS_THREADS */ -} - -ACE_FACTORY_DEFINE (Alt_Resource_Factory, My_Resource_Factory) - -int -DLL_ORB::svc (void) -{ - ACE_DEBUG ((LM_DEBUG, - "\n\trunning ORB event loop (%t)\n\n")); - - ACE_TRY_NEW_ENV - { - // Run the ORB event loop in its own thread. - this->orb_->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - ACE_PRINT_EXCEPTION (sysex, "System Exception"); - return -1; - } - ACE_CATCH (CORBA::UserException, userex) - { - ACE_PRINT_EXCEPTION (userex, "User Exception"); - return -1; - } - ACE_ENDTRY; - return 0; -} - -int -DLL_ORB::init (int argc, char *argv[]) -{ - // Prevent TAO from registering with the ACE_Object_Manager so - // that it can be dynamically unloaded successfully. - - int register_with_object_manager = 0; - if (TAO_Singleton_Manager::instance ()->init (register_with_object_manager) == -1) - { -// ACE_ERROR_RETURN ((LM_ERROR, -// "%p\n", -// "Unable to pre-initialize ORB"), -// -1); - } - - ACE_TRY_NEW_ENV - { - ACE_DEBUG ((LM_DEBUG, - "\n\tInitialize ORB (%t)\n\n")); - - // Initialize the ORB. - // Initialize the ORB. - this->orb_ = CORBA::ORB_init (argc, - argv, - "An ORB" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (this->orb_.in ())) - return -1; - - CORBA::Object_var poa_object = - this->orb_->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (CORBA::is_nil (poa_object.in ())) - ACE_ERROR_RETURN ((LM_ERROR, - " (%P|%t) Unable to initialize the POA.\n"), - 1); - - this->poa_ = - PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->poa_manager_ = - this->poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - this->poa_manager_->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - -#if defined (ACE_HAS_THREADS) - // Become an Active Object so that the ORB - // will execute in a separate thread. - return this->activate (); -#else - return 0; -#endif /* ACE_HAS_THREADS */ - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "DLL_ORB::init"); - } - ACE_ENDTRY; - - return -1; -} - -int -DLL_ORB::fini (void) -{ - return TAO_Singleton_Manager::instance ()->fini (); - // return 0; -} - -int -Time_Date_Servant::parse_args (int argc, char *argv[]) -{ - ACE_Get_Opt get_opts (argc, argv, "dn:o:"); - int c = 0; - - this->orb_ = "ORB"; - - while ((c = get_opts ()) != -1) - switch (c) - { - case 'd': // debug flag. - TAO_debug_level++; - break; - case 'o': // output the IOR to a file. - this->ior_output_file_ = ACE_OS::fopen (get_opts.opt_arg (), "w"); - if (this->ior_output_file_ == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Unable to open %s for writing: %p\n", - get_opts.opt_arg ()), -1); - break; - // Find the ORB in the Service Repository. - case 'n': - this->orb_ = get_opts.opt_arg (); - break; - case '?': // display help for use of the server. - default: - ACE_ERROR_RETURN ((LM_ERROR, - "usage: %s" - " [-d]" - " [-o] <ior_output_file>" - "\n", - argv [0]), - -1); - } - - // Indicates successful parsing of command line. - return 0; -} - -int -Time_Date_Servant::init (int argc, char *argv[]) -{ - ACE_TRY_NEW_ENV - { - ACE_DEBUG ((LM_DEBUG, - "\n\tTime_Date servant\n\n")); - - this->parse_args (argc, argv); - - DLL_ORB *orb = - ACE_Dynamic_Service<DLL_ORB>::instance (this->orb_); - - if (orb == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "can't find %s in the Service Repository\n", - this->orb_), - -1); - - Time_Date_i * servant = new Time_Date_i; - PortableServer::ServantBase_var safe_servant = servant; - - CORBA::Object_var obj = - servant->_this (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - CORBA::String_var str = - orb->orb_->object_to_string (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (this->ior_output_file_) - { - ACE_OS::fprintf (this->ior_output_file_, - "%s", - str.in ()); - ACE_OS::fclose (this->ior_output_file_); - } - - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "DLL_ORB::init"); - return -1; - } - ACE_ENDTRY; - return 0; -} - -// The following Factory is used by the <ACE_Service_Config> and -// dll_orb.conf file to dynamically initialize the state of the -// Time_Date service. -ACE_SVC_FACTORY_DEFINE (DLL_ORB) -ACE_SVC_FACTORY_DEFINE (Time_Date_Servant) - diff --git a/TAO/examples/Simple/time-date/Time_Date.h b/TAO/examples/Simple/time-date/Time_Date.h deleted file mode 100644 index 2165fddf4f3..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date.h +++ /dev/null @@ -1,100 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -#include "ace/Task.h" -#include "ace/svc_export.h" -#include "tao/default_resource.h" -#include "Alt_Resource_Factory.h" - -class Time_Date_i; - -/** - * @class My_Resource_Factory - * - * @brief Illustrates how to select the appropriate @c ACE_Reactor. - * - * If we're running in a single-threaded configuration this will be - * the @c ACE_Reactor::instance singleton. Otherwise, it'll be the - * ORB's own default @c ACE_Reactor, which is defined by the - * @c TAO_Default_Resource_Factory. - */ -class Alt_Resource_Factory_Export My_Resource_Factory - : public TAO_Default_Resource_Factory -{ -public: - - /// Return the @c ACE_Reactor that will be utilized by the ORB. - virtual ACE_Reactor *get_reactor (void); - -}; - -ACE_FACTORY_DECLARE (Alt_Resource_Factory, My_Resource_Factory) - -/** - * @class DLL_ORB - * - * @brief Define a class that dynamically links an ORB into a server - * process via the @c ACE_Service_Configurator. - */ -class ACE_Svc_Export DLL_ORB : public ACE_Task_Base -{ -public: - - /// Initialize the @c TAO_ORB_Manager. - virtual int init (int argc, char *argv[]); - - /// Shutdown the @c TAO_ORB_Manager. - virtual int fini (void); - - /// Concurrency hook. - virtual int svc (void); - -public: - - /// ORB pseudo-reference. - CORBA::ORB_var orb_; - - /// Reference to the POA. - PortableServer::POA_var poa_; - - /// Reference to the POA Manager. - PortableServer::POAManager_var poa_manager_; - -}; - -/** - * @class Time_Date_Servant - * - * @brief Define a class that dynamically links the Time_Date service - * into a server process via the @c ACE_Service_Configurator. - * Note that this assumes the ORB has been linked previously. - */ -class ACE_Svc_Export Time_Date_Servant : public ACE_Service_Object -{ -public: - - /// Initialize the @c Time_Date servant. - virtual int init (int argc, char *argv[]); - - /// Parse the "command-line" arguments. - int parse_args (int argc, char *argv[]); - -private: - - /// Servant for the @c Time_Date object. - Time_Date_i * servant_; - - /// File where the IOR of the server object is stored. - FILE *ior_output_file_; - - /// Name of the ORB we're linking dynamically. - const char *orb_; - -}; - -// The following Factory is used by the <ACE_Service_Config> and -// dll_orb.conf file to dynamically initialize the state of the -// Time_Date service. -ACE_SVC_FACTORY_DECLARE (DLL_ORB) -ACE_SVC_FACTORY_DECLARE (Time_Date_Servant) diff --git a/TAO/examples/Simple/time-date/Time_Date.idl b/TAO/examples/Simple/time-date/Time_Date.idl deleted file mode 100644 index 842d6060752..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date.idl +++ /dev/null @@ -1,14 +0,0 @@ -// -*- C++ -*- -// $Id$ - -interface Time_Date -{ - // = TITLE - // IDL schema definition for Time and Date interface. - - void bin_date (out long time_date); - // Obtain the time and date in binary format. - - void str_date (out string time_date); - // Obtain the time and date in string format. -}; diff --git a/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp b/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp deleted file mode 100644 index 4d751fcf9fa..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date_Client_i.cpp +++ /dev/null @@ -1,84 +0,0 @@ -//$Id$ - -#include "Time_Date_Client_i.h" -#include "ace/Get_Opt.h" -#include "ace/Read_Buffer.h" - -// This is the interface program that accesses the remote object - -// Constructor. -Time_Date_Client_i::Time_Date_Client_i (void) -{ - // no-op -} - -//Destructor. -Time_Date_Client_i::~Time_Date_Client_i (void) -{ - // no-op -} - -int -Time_Date_Client_i::parse_args (int, - char *[]) -{ - return 0; -} - -int -Time_Date_Client_i::run (const char *name, - int argc, - char *argv[]) -{ - // Initialize the client. - if (client_.init (name, argc, argv) == -1) - return -1; - - if (this->parse_args (argc, argv) == -1) - return -1; - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - CORBA::Long l; - - // Get the time & date in binary format. - client_->bin_date (l - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) Binary time_date = %d\n", - l)); - - // Get the time & date in string format. - CORBA::String_var str_var; - client_->str_date (str_var.out() - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - - ACE_DEBUG ((LM_DEBUG, - "(%P|%t) String time_date = %s\n", - str_var.in())); - - client_.shutdown (); - } - ACE_CATCH (CORBA::UserException, range_ex) - { - ACE_PRINT_EXCEPTION (range_ex, - "\tFrom get and set time_date"); - return -1; - } - ACE_CATCH (CORBA::SystemException, memex) - { - ACE_PRINT_EXCEPTION (memex, - "Cannot make time_date"); - return -1; - } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); - - return 0; -} - diff --git a/TAO/examples/Simple/time-date/Time_Date_Client_i.h b/TAO/examples/Simple/time-date/Time_Date_Client_i.h deleted file mode 100644 index 1d8e99e7301..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date_Client_i.h +++ /dev/null @@ -1,53 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/Simple/time-date -// -// = FILENAME -// Time_Date_Client_i.h -// -// = DESCRIPTION -// This class implements the interface calls for RMI. -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ - -#ifndef TIME_DATE_CLIENT_I_H -#define TIME_DATE_CLIENT_I_H - -#include "../Simple_util.h" -#include "Time_DateC.h" - -class Time_Date_Client_i -{ - // = TITLE - // Time_Date_Client interface adapter. - // - // = DESCRIPTION - // This class implements the interface between the interface - // objects and the client. -public: - // = Initialization and termination methods. - Time_Date_Client_i (void); - // Constructor - - virtual ~Time_Date_Client_i (void); - // Destructor - - virtual int run (const char *, int, char *[]); - // Execute the methods. - - virtual int parse_args (int argc, char *argv[]); - // Parses the command line arguments. - -private: - Client<Time_Date, Time_Date_var> client_; - // Instantiate the client object. -}; - -#endif /* TIME_CLIENT_I_H */ diff --git a/TAO/examples/Simple/time-date/Time_Date_i.cpp b/TAO/examples/Simple/time-date/Time_Date_i.cpp deleted file mode 100644 index daf4a6ee737..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date_i.cpp +++ /dev/null @@ -1,33 +0,0 @@ -// -*- C++ -*- -// $Id$ - -#include "Time_Date_i.h" -#include "ace/OS_NS_time.h" - -// Obtain the time and date in binary format. - -void -Time_Date_i::bin_date (CORBA::Long_out time_date - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - time_date = ACE_OS::time (0); -} - -// Obtain the time and date in string format. - -void -Time_Date_i::str_date (CORBA::String_out time_date - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - const time_t time = ACE_OS::time (0); - - time_date = CORBA::string_dup (ACE_OS::ctime (&time)); -} - -void -Time_Date_i::orb (CORBA::ORB_ptr orb_ptr) -{ - orb_var_ = CORBA::ORB::_duplicate (orb_ptr); -} diff --git a/TAO/examples/Simple/time-date/Time_Date_i.h b/TAO/examples/Simple/time-date/Time_Date_i.h deleted file mode 100644 index 2957a71a68d..00000000000 --- a/TAO/examples/Simple/time-date/Time_Date_i.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- C++ -*- -// -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/tests/Simple/time_date -// -// = FILENAME -// Time_Date_i.h -// -// = DESCRIPTION -// This class implements the Time_Date IDL interface. -// -// = AUTHOR -// Douglas C. Schmidt <schmidt@cs.wustl.edu> and Michael Kircher. -// -// ============================================================================ - -#ifndef TIME_DATE_I_H -#define TIME_DATE_I_H - -#include "Time_DateS.h" - -class Time_Date_i - : public POA_Time_Date -{ - // = TITLE - // Time_Date object implementation. - // - // = DESCRIPTION - // Time_Date object implementation -public: - // = Initialization and termination methods. - - virtual void bin_date (CORBA::Long_out time_date - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Obtain the time and date in binary format. - - virtual void str_date (CORBA::String_out time_date - ACE_ENV_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Obtain the time and date in string format. - - void orb (CORBA::ORB_ptr orb_ptr); - // ORB pointer. - -private: - CORBA::ORB_var orb_var_; - // ORB pointer. -}; - -#endif /* TIME_DATE_I_H */ diff --git a/TAO/examples/Simple/time-date/client.conf b/TAO/examples/Simple/time-date/client.conf deleted file mode 100644 index a72676ee49a..00000000000 --- a/TAO/examples/Simple/time-date/client.conf +++ /dev/null @@ -1,5 +0,0 @@ -# $Id$ - -# Empty configuration file, the default configuration works just fine -# for the client, but the svc.conf file (or -ORBSkipServiceConfigOpen) -# breaks it. diff --git a/TAO/examples/Simple/time-date/client.conf.xml b/TAO/examples/Simple/time-date/client.conf.xml deleted file mode 100644 index 7864e7bebae..00000000000 --- a/TAO/examples/Simple/time-date/client.conf.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./examples/Simple/time-date/client.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- $Id$ --> - <!-- Empty configuration file, the default configuration works just fine --> - <!-- for the client, but the svc.conf file (or -ORBSkipServiceConfigOpen) --> - <!-- breaks it. --> -</ACE_Svc_Conf> diff --git a/TAO/examples/Simple/time-date/client.cpp b/TAO/examples/Simple/time-date/client.cpp deleted file mode 100644 index 452afbec7fa..00000000000 --- a/TAO/examples/Simple/time-date/client.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// $Id$ - -# include "Time_Date_Client_i.h" - -// The client program for the application. - -int -main (int argc, char *argv[]) -{ - Time_Date_Client_i client; - - ACE_DEBUG ((LM_DEBUG, - "\nTime_Date client\n\n")); - - if (client.run ("Time_Date", argc, argv) == -1) - return -1; - else - return 0; -} diff --git a/TAO/examples/Simple/time-date/run_test.pl b/TAO/examples/Simple/time-date/run_test.pl deleted file mode 100755 index ec0290a14bd..00000000000 --- a/TAO/examples/Simple/time-date/run_test.pl +++ /dev/null @@ -1,57 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib "../../../../bin"; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = "ior"; -$conf = PerlACE::LocalFile ("client" . "$PerlACE::svcconf_ext"); - -# Remove the file before starting the test. -unlink $iorfile; - -sub add_path { - my($name) = shift; - my($value) = shift; - if (defined $ENV{$name}) { - $ENV{$name} .= ':' . $value - } - else { - $ENV{$name} = $value; - } -} - -# Set the library path for the client to be able to load -# the Time_Date library. -add_path('LD_LIBRARY_PATH', '.'); -add_path('LIBPATH', '.'); -add_path('SHLIB_PATH', '.'); - -$SV = new PerlACE::Process ("server"); -$CL = new PerlACE::Process ("client", "-f $iorfile -ORBSvcConf $conf"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) { - print STDERR "ERROR: waiting for file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$SV->Kill (); - -unlink $iorfile; - -exit $status; diff --git a/TAO/examples/Simple/time-date/server.cpp b/TAO/examples/Simple/time-date/server.cpp deleted file mode 100644 index f9ddbadc4bb..00000000000 --- a/TAO/examples/Simple/time-date/server.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// examples/Simple/time-date -// -// = FILENAME -// server.cpp -// -// = DESCRIPTION -// This directory contains an example that illustrates how the ACE -// Service Configurator can dynamically configure an ORB and its -// servants from a svc.conf file. -// -// = AUTHOR -// Doug Schmidt <schmidt@cs.wustl.edu> -// -// ============================================================================ - -#include "ace/Service_Config.h" -#include "ace/Reactor.h" -#include "ace/Log_Msg.h" - -ACE_RCSID (time_date, - server, - "$Id$") - -int -main (int argc, char *argv[]) -{ - if (ACE_Service_Config::open (argc, argv) == -1 - && errno != ENOENT) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("%p\n"), - ACE_TEXT ("open")), - 1); - - // Run forever, performing the configured services until we - // shutdown. - ACE_Reactor::run_event_loop (); - return 0; -} diff --git a/TAO/examples/Simple/time-date/svc.conf b/TAO/examples/Simple/time-date/svc.conf deleted file mode 100644 index feed2720801..00000000000 --- a/TAO/examples/Simple/time-date/svc.conf +++ /dev/null @@ -1,11 +0,0 @@ -# $Id$ -# Define a special Reactor for single-threaded configurations. Refer -# to README for details. -dynamic Resource_Factory Service_Object * Time_Date:_make_My_Resource_Factory() - -# Dynamically configure the ORB into the application process. -dynamic ORB Service_Object * Time_Date:_make_DLL_ORB() "dummy" - -# Once the ORB is configured, dynamically configure the Time_Date service. -dynamic Time_Date_Servant Service_Object * Time_Date:_make_Time_Date_Servant() "dummy -n ORB -o ior" - diff --git a/TAO/examples/Simple/time-date/svc.conf.xml b/TAO/examples/Simple/time-date/svc.conf.xml deleted file mode 100644 index 2d9c7fed9eb..00000000000 --- a/TAO/examples/Simple/time-date/svc.conf.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version='1.0'?> -<!-- Converted from ./examples/Simple/time-date/svc.conf by svcconf-convert.pl --> -<ACE_Svc_Conf> - <!-- $Id$ --> - <!-- Define a special Reactor for single-threaded configurations. Refer --> - <!-- to README for details. --> - <dynamic id="Resource_Factory" type="Service_Object"> - <initializer path="./Time_Date" init="_make_My_Resource_Factory"/> - </dynamic> - <!-- Dynamically configure the ORB into the application process. --> - <dynamic id="ORB" type="Service_Object"> - <initializer path="./Time_Date" init="_make_DLL_ORB" params="dummy"/> - </dynamic> - <!-- Once the ORB is configured, dynamically configure the Time_Date service. --> - <dynamic id="Time_Date_Servant" type="Service_Object"> - <initializer path="./Time_Date" init="_make_Time_Date_Servant" params="dummy -n ORB -o ior"/> - </dynamic> -</ACE_Svc_Conf> diff --git a/TAO/examples/Simple/time/Makefile.am b/TAO/examples/Simple/time/Makefile.am deleted file mode 100644 index 4fb39bc1b33..00000000000 --- a/TAO/examples/Simple/time/Makefile.am +++ /dev/null @@ -1,117 +0,0 @@ -## Process this file with automake to create Makefile.in -## -## $Id$ -## -## This file was generated by MPC. Any changes made directly to -## this file will be lost the next time it is generated. -## -## MPC Command: -## ../bin/mwc.pl -type automake -noreldefs TAO.mwc - -ACE_BUILDDIR = $(top_builddir)/.. -ACE_ROOT = $(top_srcdir)/.. -TAO_BUILDDIR = $(top_builddir) -TAO_IDL = ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl -TAO_IDLFLAGS = -Ge 1 -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf -TAO_ROOT = $(top_srcdir) - -## Makefile.time_IDL.am - -BUILT_SOURCES = \ - TimeC.cpp \ - TimeC.h \ - TimeC.inl \ - TimeS.cpp \ - TimeS.h \ - TimeS.inl - -CLEANFILES = \ - Time-stamp \ - TimeC.cpp \ - TimeC.h \ - TimeC.inl \ - TimeS.cpp \ - TimeS.h \ - TimeS.inl - -TimeC.cpp TimeC.h TimeC.inl TimeS.cpp TimeS.h TimeS.inl: Time-stamp - -Time-stamp: $(srcdir)/Time.idl $(TAO_IDL_DEP) - $(TAO_IDL) $(TAO_IDLFLAGS) -Sa -St $(srcdir)/Time.idl - @touch $@ - - -noinst_HEADERS = \ - Time.idl - -## Makefile.time_client.am - -noinst_PROGRAMS = client - -client_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -client_SOURCES = \ - ../Simple_util.cpp \ - TimeC.cpp \ - Time_Client_i.cpp \ - client.cpp \ - ../Simple_util.h \ - Time_Client_i.h - -client_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Makefile.time_server.am - -noinst_PROGRAMS += server - -server_CPPFLAGS = \ - -I$(ACE_ROOT) \ - -I$(ACE_BUILDDIR) \ - -I$(TAO_ROOT) \ - -I$(TAO_BUILDDIR) \ - -I$(TAO_ROOT)/orbsvcs \ - -I$(TAO_BUILDDIR)/orbsvcs - -server_SOURCES = \ - ../Simple_util.cpp \ - TimeC.cpp \ - TimeS.cpp \ - Time_i.cpp \ - server.cpp \ - ../Simple_util.h \ - Time_i.h - -server_LDADD = \ - $(TAO_BUILDDIR)/tao/libTAO_Utils.la \ - $(TAO_BUILDDIR)/tao/libTAO_PI.la \ - $(TAO_BUILDDIR)/tao/libTAO_CodecFactory.la \ - $(TAO_BUILDDIR)/tao/libTAO_PortableServer.la \ - $(TAO_BUILDDIR)/tao/libTAO_IORTable.la \ - $(TAO_BUILDDIR)/orbsvcs/orbsvcs/libTAO_CosNaming.la \ - $(TAO_BUILDDIR)/tao/libTAO_AnyTypeCode.la \ - $(TAO_BUILDDIR)/tao/libTAO.la \ - $(ACE_BUILDDIR)/ace/libACE.la - -## Clean up template repositories, etc. -clean-local: - -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* - -rm -f gcctemp.c gcctemp so_locations *.ics - -rm -rf cxx_repository ptrepository ti_files - -rm -rf templateregistry ir.out - -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/TAO/examples/Simple/time/README b/TAO/examples/Simple/time/README deleted file mode 100644 index 5c67c8bbf4f..00000000000 --- a/TAO/examples/Simple/time/README +++ /dev/null @@ -1,89 +0,0 @@ -$Id$ - -This is a simple CORBA example that has an object (Time) with two -methods: one that returns the current time of day and another that -shuts down the server. There are clients programs written in both C++ -and Java to access the simple Time service. The Java client uses -JACE's GetOpt class to parse the command line arguments. See - - http://www.cs.wustl.edu/~schmidt/JACE.html - http://ace.cs.wustl.edu/cvsweb/ace-latest.cgi/ACE_wrappers/java/JACE/Misc/GetOpt.java - -for more details. - -run_test.pl : This is a perl script to run the server and client as : ------------- - server -o ior_file - client -f ior_file - -This perl script runs the server and client and shuts down the server -when it is done. - -Passing the Server IOR to Clients: ---------------------------------- - -To keep this example simple, the server advertises its IOR in the -following manner - The server program writes its server object's IOR -to a ior_file. Later on, the client reads this IOR from the specified -ior_file and uses the <string_to_object> method to obtain a reference -to the server object. - -For this mechanism to work, the file must be readable and writable. If -it doesn't exist, a new file is created by the server. Moreover, the -file path must be accessible to both the client and server. - -If the client and server are on different machine, then there must be -a shared directory accessible by both. On UNIX system's this is -typically done via the NFS mount command. On Windows, the 'explorer' -application provides an option to share drives. - -In general if no such file sharing option is available, then using the -the Naming Service mechanism is the only alternative, as descrbed by -the -n option below. - -server: -------- - -server [-nd] [-o <ior_output_file>] - -Options: -------- --o Outputs the server ior to the file - -When the server is started, you should see as the first line of output -something that looks like - iiop:1.0//danzon.cs.wustl.edu:10015/P35ad159600081a38/child_poa/server - (-ORBobjrefstyle url) -or - IOR:000000000000001649444c3a43756269745... - (-ORBobjrefstyle ior) - -The -o option makes it easier to run from a script because the ior -passing is done through the <ior_output_file>. - --d Debug flag --n Use the naming service - -Using -d turns on debugging messages. This option is additive, i.e., -the more -d options provided, the more debugging you can get. At the -moment, only 2 levels of debugging are implemented, and more than 2 -d -options are ignored. - -client: -------- - -client [-d] [-x] [-f <Server_ior_file>] [-n iterations] [-k ior] - -Options: -------- --d Debug flag --x Tells the server to shutdown at the end of the test. --f Reads the server ior from the file --n Use the naming service --k IOR or The IOR can also be given in the format like file://[file.ior] - with the full path - -You can either cut and paste the IOR from the server to the client -(with the -k option), or have the client read the IOR from a file -using the -f option. (This file is produced using the -o option with the -server.) diff --git a/TAO/examples/Simple/time/Time.idl b/TAO/examples/Simple/time/Time.idl deleted file mode 100644 index 66521161fab..00000000000 --- a/TAO/examples/Simple/time/Time.idl +++ /dev/null @@ -1,15 +0,0 @@ -/* -*- C++ -*- */ -// $Id$ - -interface Time -{ - // = TITLE - // Defines an interface that encapsulates operations that - // return the current time of day and shuts down the server. - - long current_time (); - // Returns the current time of day on another machine. - - oneway void shutdown (); - // Shutdown the application. -}; diff --git a/TAO/examples/Simple/time/Time_Client.java b/TAO/examples/Simple/time/Time_Client.java deleted file mode 100644 index 6f430ec48ad..00000000000 --- a/TAO/examples/Simple/time/Time_Client.java +++ /dev/null @@ -1,154 +0,0 @@ -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/Simple/time -// -// = FILENAME -// Time_Client.java -// -// = DESCRIPTION -// This class implements a Java client interface to the Time example. -// -// = AUTHOR -// Martin Krumpolec <krumpo@pobox.sk> -// -// ============================================================================ - -import JACE.Misc.GetOpt; -import org.omg.CosNaming.*; -import org.omg.CORBA.*; -import java.io.*; - -public class Time_Client -{ - private ORB orb = null; - private org.omg.CORBA.Object timeRef = null; - private boolean shutdown = false; - private boolean use_naming_service = false; - private String ior_file = null; - private String ior = null; - - Time_Client (String args []) - { - orb = ORB.init (args, null); - parse_args (args); - } - - private void parse_args (String args[]) - { - GetOpt getopt = new GetOpt (args, "k:f:xn"); - - int ch = -1; - - while ((ch = getopt.next ()) != -1) - { - switch (ch) - { - case 'k': - ior = getopt.opt_arg () (); - break; - case 'f': - ior_file = getopt.opt_arg () (); - try - { - java.io.FileInputStream file = - new FileInputStream(ior_file); - java.io.BufferedReader myInput = - new BufferedReader - (new InputStreamReader (file)); - ior = myInput.readLine(); - } - catch (Exception e) - { - System.out.println ("Error: " + e); - } - break; - case 'x': - shutdown = true; - break; - case 'n': - use_naming_service = true; - break; - default: - break; - } - } - - return; - } - - private Time get_time_object () - { - if (ior != null) - { - org.omg.CORBA.Object objref = orb.string_to_object (ior); - return TimeHelper.narrow (objref); - } - else - { - if (use_naming_service) - { - // Use multicast to obtain NS handle. - NS_Resolve ns_resolve = - new NS_Resolve (null); - org.omg.CORBA.Object objRef = - ns_resolve.resolve_name_service (orb); - - // Get the root naming context. - NamingContext ncRef = - NamingContextHelper.narrow (objRef); - System.out.println ("got initial NS reference"); - - // Resolve the Object Reference in Naming. - NameComponent nc = - new NameComponent ("Time", ""); - NameComponent path[] = {nc}; - try - { - return TimeHelper.narrow (ncRef.resolve (path)); - } - catch (Exception e) - { - System.out.println ("Error: " + e); - } - } - } - return null; - } - - public static void main (String args[]) - { - try - { - Time_Client client = new Time_Client (args); - Time timeRef = client.get_time_object (); - - if (timeRef == null) - { - System.out.println ("Unable to resolve Time."); - System.exit (-1); - } - - // Call the Time server object and print results. - int time = timeRef.current_time (); - - java.util.Date date = - new java.util.Date (((long) time) * 1000); - - System.out.println ("string time is " + date); - - if (client.shutdown) - { - timeRef.shutdown (); - System.out.println ("Shutting down server ..."); - } - } - catch (Exception e) - { - System.out.println ("ERROR : " + e) ; - e.printStackTrace (System.out); - } - } -} diff --git a/TAO/examples/Simple/time/Time_Client_i.cpp b/TAO/examples/Simple/time/Time_Client_i.cpp deleted file mode 100644 index ace24d63d6e..00000000000 --- a/TAO/examples/Simple/time/Time_Client_i.cpp +++ /dev/null @@ -1,74 +0,0 @@ -//$Id$ - -#include "Time_Client_i.h" -#include "ace/OS_NS_time.h" - -// This is the interface program that accesses the remote object - -// Constructor. -Time_Client_i::Time_Client_i (void) -{ - //no-op -} - -//Destructor. -Time_Client_i::~Time_Client_i (void) -{ - //no-op -} - -int -Time_Client_i::run (const char *name, - int argc, - char *argv[]) -{ - // Initialize the client. - if (client.init (name, argc, argv) == -1) - return -1; - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - // 64-bit OS's require pointers to be aligned on an - // 8 byte boundary. 64-bit HP-UX requires a double to do this - // while a long does it for 64-bit Solaris. -#if defined (HPUX) - CORBA::Double padding; -#else - CORBA::Long padding; -#endif /* HPUX */ - CORBA::Long timedate; - - ACE_UNUSED_ARG (padding); - - //Make the RMI. - timedate = client->current_time (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - // Print out value - // Use ACE_OS::ctime_r(), ctime() doesn't seem to work properly - // under 64-bit solaris. - ACE_TCHAR ascii_timedate[64] = ""; - ACE_OS::ctime_r (reinterpret_cast<const time_t *> (&timedate), - ascii_timedate, 64); - - ACE_DEBUG ((LM_DEBUG, - "string time is %s\n", - ascii_timedate)); - - if (client.shutdown () == 1) - client->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "\tException"); - return -1; - } - ACE_ENDTRY; - - - return 0; -} - diff --git a/TAO/examples/Simple/time/Time_Client_i.h b/TAO/examples/Simple/time/Time_Client_i.h deleted file mode 100644 index 96c9c176011..00000000000 --- a/TAO/examples/Simple/time/Time_Client_i.h +++ /dev/null @@ -1,51 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/Simple/time -// -// = FILENAME -// Time_Client_i.h -// -// = DESCRIPTION -// This class implements the client calls to the Time example. -// -// = AUTHOR -// Balachandran Natarajan <bala@cs.wustl.edu> -// -// ============================================================================ - -#ifndef TIME_CLIENT_I_H -#define TIME_CLIENT_I_H - -#include "../Simple_util.h" -#include "TimeC.h" - -class Time_Client_i -{ - // = TITLE - // Time_Client interface subclass. - // - // = DESCRIPTION - // This class implements the interface between the interface - // objects and the client. -public: - // = Initialization and termination methods. - Time_Client_i (void); - // Constructor - - virtual ~Time_Client_i (void); - // Destructor - - virtual int run (const char *,int, char** ); - // Execute the methods - -private: - Client<Time, Time_var> client; - // Instantiate the client object. -}; - - -#endif /* TIME_CLIENT_I_H */ diff --git a/TAO/examples/Simple/time/Time_i.cpp b/TAO/examples/Simple/time/Time_i.cpp deleted file mode 100644 index c9905bef9b7..00000000000 --- a/TAO/examples/Simple/time/Time_i.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// $Id$ - -#include "Time_i.h" -#include "ace/OS_NS_time.h" - -ACE_RCSID(Time, Time_i, "$Id$") - -// Constructor -Time_i::Time_i (void) -{ - // no-op -} - -// Destructor - -Time_i::~Time_i (void) -{ - // no-op -} - -// Set the ORB pointer. - -void -Time_i::orb (CORBA::ORB_ptr o) -{ - this->orb_ = CORBA::ORB::_duplicate (o); -} - -// Return the current date/time on the server. - -CORBA::Long -Time_i::current_time (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - return CORBA::Long (ACE_OS::time (0)); -} - -// Shutdown. - -void -Time_i::shutdown (ACE_ENV_SINGLE_ARG_DECL_NOT_USED ) - ACE_THROW_SPEC ((CORBA::SystemException)) -{ - ACE_DEBUG ((LM_DEBUG, - "%s\n", - "Time_i is shutting down")); - - // Instruct the ORB to shutdown. - this->orb_->shutdown (); -} - diff --git a/TAO/examples/Simple/time/Time_i.h b/TAO/examples/Simple/time/Time_i.h deleted file mode 100644 index ae0ec382ff5..00000000000 --- a/TAO/examples/Simple/time/Time_i.h +++ /dev/null @@ -1,62 +0,0 @@ -// -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO/examples/Simple/time -// -// = FILENAME -// Time_i.h -// -// = DESCRIPTION -// This class implements the Time IDL interface. -// -// = AUTHOR -// Darrell Brunsch <brunsch@cs.wustl.edu> -// -// ============================================================================ - -#ifndef TIME_I_H -#define TIME_I_H - -#include "TimeS.h" - -class Time_i: public POA_Time -{ - // = TITLE - // Time Object Implementation - // - // = DESCRIPTION - // Implementation of a simple object that has two methods, one that - // return the current time/date on the server and the other that - // shuts down the server. -public: - // = Initialization and termination methods. - Time_i (void); - // Constructor - - ~Time_i (void); - // Destructor - - virtual CORBA::Long current_time (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - // Return the current time/date on the server - - virtual void shutdown (ACE_ENV_SINGLE_ARG_DECL) - ACE_THROW_SPEC ((CORBA::SystemException)); - - // Shutdown the server. - - void orb (CORBA::ORB_ptr o); - // Set the ORB pointer. - -private: - CORBA::ORB_var orb_; - // ORB pointer. - - ACE_UNIMPLEMENTED_FUNC (void operator= (const Time_i &)) - // Keeping g++2.7.2 -}; - -#endif /* TIME_I_H */ diff --git a/TAO/examples/Simple/time/client.cpp b/TAO/examples/Simple/time/client.cpp deleted file mode 100644 index 28eab3cb977..00000000000 --- a/TAO/examples/Simple/time/client.cpp +++ /dev/null @@ -1,23 +0,0 @@ -//$Id$ - -# include "Time_Client_i.h" - -// The client program for the application. - -int -main (int argc, char **argv) -{ - Time_Client_i client; - - - ACE_DEBUG ((LM_DEBUG, - "\n\tTime and date client\n\n")); - - if (client.run ("Time",argc, argv) == -1) - return -1; - else - return 0; - -} - - diff --git a/TAO/examples/Simple/time/run_test.pl b/TAO/examples/Simple/time/run_test.pl deleted file mode 100755 index 5bd82f64937..00000000000 --- a/TAO/examples/Simple/time/run_test.pl +++ /dev/null @@ -1,43 +0,0 @@ -eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' - & eval 'exec perl -S $0 $argv:q' - if 0; - -# $Id$ -# -*- perl -*- - -use lib '../../../../bin'; -use PerlACE::Run_Test; - -$status = 0; -$iorfile = PerlACE::LocalFile ("time.ior"); - -unlink $iorfile; - -$SV = new PerlACE::Process ("server", "-o $iorfile"); -$CL = new PerlACE::Process ("client", "-f $iorfile -x"); - -$SV->Spawn (); - -if (PerlACE::waitforfile_timed ($iorfile, 10) == -1) { - print STDERR "ERROR: Could not find file <$iorfile>\n"; - $SV->Kill (); - exit 1; -} - -$client = $CL->SpawnWaitKill (60); - -if ($client != 0) { - print STDERR "ERROR: client returned $client\n"; - $status = 1; -} - -$server = $SV->WaitKill (5); - -if ($server != 0) { - print STDERR "ERROR: server returned $server\n"; - $status = 1; -} - -unlink $iorfile; - -exit $status; diff --git a/TAO/examples/Simple/time/server.cpp b/TAO/examples/Simple/time/server.cpp deleted file mode 100644 index 8c3792e16b5..00000000000 --- a/TAO/examples/Simple/time/server.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// $Id$ -#include "../Simple_util.h" -#include "Time_i.h" - -// This is the main driver program for the time and date server. - -int -main (int argc, char *argv[]) -{ - Server<Time_i> server; - - ACE_DEBUG ((LM_DEBUG, - "\n\tTime and Date server\n\n")); - - ACE_DECLARE_NEW_CORBA_ENV; - - ACE_TRY - { - if (server.init ("Time", - argc, - argv - ACE_ENV_ARG_PARAMETER) == -1) - return 1; - else - { - server.run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCH (CORBA::UserException, userex) - { - ACE_PRINT_EXCEPTION (userex,"User Exception in main"); - return -1; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - ACE_PRINT_EXCEPTION (sysex,"System Exception in main"); - return -1; - } - ACE_ENDTRY; - return 0; -} - diff --git a/TAO/examples/Simple/time/time.mpc b/TAO/examples/Simple/time/time.mpc deleted file mode 100644 index 91288d3e8b4..00000000000 --- a/TAO/examples/Simple/time/time.mpc +++ /dev/null @@ -1,36 +0,0 @@ -// -*- MPC -*- -// $Id$ - -project(*IDL): taoidldefaults { - IDL_Files { - Time.idl - } - custom_only = 1 -} - -project(*server): namingexe, iortable, utils { - exename = server - after += *IDL - Source_Files { - Time_i.cpp - server.cpp - ../Simple_util.cpp - TimeS.cpp - TimeC.cpp - } - IDL_Files { - } -} - -project(*client): namingexe, iortable, utils { - exename = client - after += *IDL - Source_Files { - client.cpp - ../Simple_util.cpp - Time_Client_i.cpp - TimeC.cpp - } - IDL_Files { - } -} |