diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-20 00:01:07 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-04-20 00:01:07 +0000 |
commit | 58a5bab23946037ffd913a1902eeb1eee7e77cad (patch) | |
tree | 9debe6890c131d5b494b9b290b556670e1d1a82c | |
parent | 2418fe7c652d3cdaf9c3ff4e0c4b477d6b7faa1d (diff) | |
download | ATCD-58a5bab23946037ffd913a1902eeb1eee7e77cad.tar.gz |
New ImplRepo command line application
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/tao_ir.cpp | 17 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/tao_ir.dsp | 107 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/tao_ir_i.cpp | 95 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/tao_ir_i.h | 61 |
4 files changed, 280 insertions, 0 deletions
diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_ir.cpp b/TAO/orbsvcs/ImplRepo_Service/tao_ir.cpp new file mode 100644 index 00000000000..24f542c2c02 --- /dev/null +++ b/TAO/orbsvcs/ImplRepo_Service/tao_ir.cpp @@ -0,0 +1,17 @@ +/* -*- C++ -*- */ +// $Id$ + +#include "tao_ir_i.h" + +ACE_RCSID(ImplRepo_Service, tao_ir, "$Id$") + +int +main (int argc, ASYS_TCHAR *argv[]) +{ + TAO_IR_i tao_ir_i; + + if (tao_ir_i.init (argc, argv) == -1) + return 1; + else + return tao_ir_i.run (); +} diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_ir.dsp b/TAO/orbsvcs/ImplRepo_Service/tao_ir.dsp new file mode 100644 index 00000000000..516a8b2165c --- /dev/null +++ b/TAO/orbsvcs/ImplRepo_Service/tao_ir.dsp @@ -0,0 +1,107 @@ +# Microsoft Developer Studio Project File - Name="tao_ir" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=tao_ir - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "tao_ir.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "tao_ir.mak" CFG="tao_ir - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "tao_ir - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "tao_ir - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "tao_ir - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "tao_ir___Win32_Release"
+# PROP BASE Intermediate_Dir "tao_ir___Win32_Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\\" /I "..\..\\" /I "..\..\..\\" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 ace.lib TAO.lib orbsvcs.lib /nologo /subsystem:console /machine:I386 /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+
+!ELSEIF "$(CFG)" == "tao_ir - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "tao_ir___Win32_Debug"
+# PROP BASE Intermediate_Dir "tao_ir___Win32_Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir ""
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\\" /I "..\..\\" /I "..\..\..\\" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 aced.lib TAOd.lib orbsvcsd.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\orbsvcs" /libpath:"..\..\tao" /libpath:"..\..\..\ace"
+
+!ENDIF
+
+# Begin Target
+
+# Name "tao_ir - Win32 Release"
+# Name "tao_ir - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\tao_ir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\tao_ir_i.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\tao_ir_i.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.cpp b/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.cpp new file mode 100644 index 00000000000..f606ca7ffbf --- /dev/null +++ b/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.cpp @@ -0,0 +1,95 @@ +// $Id$ + +#include "TAO_IR_i.h" +#include "ace/Get_Opt.h" +#include "ace/Read_Buffer.h" + +ACE_RCSID(ImplRepo_Service, TAO_IR_i, "$Id") + +// Constructor + +TAO_IR_i::TAO_IR_i (void) +{ + // Nothing +} + + +// Destructor + +TAO_IR_i::~TAO_IR_i (void) +{ + // Nothing +} + +int +TAO_IR_i::run () +{ + return 0; +} + +int +TAO_IR_i::init (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_, + "internet", + ACE_TRY_ENV); + ACE_TRY_CHECK; + + // Parse command line and verify parameters. + if (this->parse_args () == -1) + return -1; + + } + ACE_CATCHANY + { + ACE_TRY_ENV.print_exception ("TAO_IR_i::init"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +int +TAO_IR_i::parse_args (void) +{ + if (this->argc_ < 2) + { + ACE_ERROR ((LM_ERROR, + "Usage: %s [options] command [command-arguments]\n", + this->argv[0])); + ACE_ERROR ((LM_ERROR, " where [options] are ORB options\n")); + ACE_ERROR ((LM_ERROR, " where command is:\n")); + ACE_ERROR ((LM_ERROR, " add - Add an entry to the IR\n")); + ACE_ERROR ((LM_ERROR, " remove - Remove an entry from the IR\n")); + ACE_ERROR ((LM_ERROR, " update - Update an entry in the IR\n")); + ACE_ERROR ((LM_ERROR, " list - List the entries in the IR\n")); + ACE_ERROR ((LM_ERROR, " where [command-arguments] depend on the command\n")); + return -1; + } + + if (ACE_OS::stricmp (this->argv[1], ASYS_TEXT ("add"))) + { + } + else if (ACE_OS::stricmp (this->argv[1], ASYS_TEXT ("remove"))) + { + } + else if (ACE_OS::stricmp (this->argv[1], ASYS_TEXT ("update"))) + { + } + else if (ACE_OS::stricmp (this->argv[1], ASYS_TEXT ("list"))) + { + } + + // Indicates successful parsing of command line. + return 0; +} + diff --git a/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.h b/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.h new file mode 100644 index 00000000000..bca219b2ed7 --- /dev/null +++ b/TAO/orbsvcs/ImplRepo_Service/tao_ir_i.h @@ -0,0 +1,61 @@ +/* -*- C++ -*- */ +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO/orbsvcs/ImplRepo_Service +// +// = FILENAME +// tao_ir_i.h +// +// = DESCRIPTION +// This class implements the Implementation Repository helper application. +// +// = AUTHOR +// Darrell Brunsch <brunsch@cs.wustl.edu> +// +// ============================================================================ + +#if !defined (TAO_IR_I_H) +#define TAO_IR_I_H + +#include "tao/corba.h" +#include "orbsvcs/ImplRepoC.h" + +class TAO_IR_i +{ + // = TITLE + // TAO's command line helper application + // + // = DESCRIPTION + // This class talks to the IR and registers/lists/etc. +public: + // = Constructor and destructor. + TAO_IR_i (void); + ~TAO_IR_i (void); + + int run (); + // Execute client code. + + int init (int argc, char **argv); + // Initialize the client communication endpoint with server. + +private: + 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. + + int argc_; + // # of arguments on the command line. + + ASYS_TCHAR **argv_; + // arguments from command line. + + CORBA::ORB_var orb_; + // Remember our orb. +}; + +#endif /* TAO_IR_I_H */ |