Changeset 19540

Show
Ignore:
Timestamp:
11/15/06 10:20:34 (2 years ago)
Author:
patrick
Message:

Replace the use of vpr::ReturnStatus? with bool in tweek::CorbaManager?,
tweek::SubjectManagerImpl?, and tweek::CorbaService?. I decided to make this
change because I suspect that not many people are using the Tweek C++ API,
and it's an easy migration for those who are.

Bumped version to 1.1.10 to mark this change.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/trunk/modules/tweek/ChangeLog

    r19384 r19540  
    11DATE       AUTHOR      CHANGE 
    22---------- ----------- -------------------------------------------------------- 
     32006-11-15 patrick     Replaced the use of vpr::ReturnStatus with bool in 
     4                       tweek::CorbaManager, tweek::SubjectManagerImpl, and 
     5                       tweek::CorbaService. 
     6                       NEW VERSION: 1.1.10 
    372006-10-01 patrick     Updated for VPR 1.1.35. 
    48                       NEW VERSION: 1.1.9 
  • juggler/trunk/modules/tweek/VERSION

    r19362 r19540  
     11.1.10-0 @11/15/2006 16:20:00 UTC@ 
    121.1.9-0 @10/01/2006 21:45:00 UTC@ 
    231.1.8-0 @10/01/2006 16:35:00 UTC@ 
  • juggler/trunk/modules/tweek/doc/programmer.guide/programmer.guide.xml

    r19538 r19540  
    11701170                     linkends="TweekApp.cpp.big-try-catch.co" /> 
    11711171   { 
    1172       if ( mgr.init("example", argc, argv).success() )        <co 
     1172      if ( mgr.init("example", argc, argv) )                  <co 
    11731173                     id="TweekApp.cpp.corbamgr.init" 
    11741174                     linkends="TweekApp.cpp.corbamgr.init.co" /> 
    11751175      { 
    1176          vpr::ReturnStatus status
     1176         bool status(false)
    11771177 
    11781178         // Once the CORBA Manager is initialized, we need 
     
    11851185            // If we were able to create the Subject Manager, 
    11861186            // now we register our objects with it. 
    1187             if ( status.success()
     1187            if ( status
    11881188            { 
    11891189               // First, create real instances of the C++ 
     
    12181218         } 
    12191219 
    1220          if ( ! status.success()
     1220         if ( ! status
    12211221         { 
    12221222            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
     
    13771377   try 
    13781378   { 
    1379       if ( mgr.init("corba_test", argc, argv).success()
     1379      if ( mgr.init("corba_test", argc, argv)
    13801380      { 
    1381          vpr::ReturnStatus status
     1381         bool status(false)
    13821382 
    13831383         // Once the CORBA Manager is initialized, we need to 
     
    13921392            // If we were able to create the Subject Manager, 
    13931393            // now we register our objects with it. 
    1394             if ( status.success()
     1394            if ( status
    13951395            { 
    13961396               // First, create real instances of the C++ 
     
    14311431         } 
    14321432 
    1433          if ( ! status.success()
     1433         if ( ! status
    14341434         { 
    14351435            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
     
    24012401   try 
    24022402   { 
    2403       if ( mgr.init("corba_test", argc, argv).success() )     <co 
     2403      if ( mgr.init("corba_test", argc, argv) )               <co 
    24042404                        id="SliderSubjectApp.cpp.corbamgr.init" 
    24052405                        linkends="SliderSubjectApp.cpp.corbamgr.co" /> 
    24062406      { 
    2407          vpr::ReturnStatus status
     2407         bool status(false)
    24082408 
    24092409         // Once the CORBA Manager is initialized, we need to 
     
    24182418            // If we were able to create the Subject Manager, 
    24192419            // now we register our objects with it. 
    2420             if ( status.success()
     2420            if ( status
    24212421            { 
    24222422               // First, create real instances of the C++ 
     
    24572457         } 
    24582458 
    2459          if ( ! status.success()
     2459         if ( ! status
    24602460         { 
    24612461            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
     
    44014401   { 
    44024402      // Attempt to initialize the CORBA Service. 
    4403       if ( corba_service.init(argc, argv).success() )           <co 
     4403      if ( corba_service.init(argc, argv) )                     <co 
    44044404                        id="client.cpp.main.corba-service.init" 
    44054405                        linkends="client.cpp.main.corba-service.init.co" /> 
     
    49854985ALL_CLASSES=    networktest/*.class 
    49864986 
    4987 include $(TWEEK_BASE_DIR)/share/tweek/tweek.appdefs.mk 
     4987DZR_BASE_DIR=   $(shell flagpoll doozer --get-prefix) 
     4988include $(DZR_BASE_DIR)/ext/tweek/dzr.tweek.mk 
    49884989 
    49894990CXX_GEN_DIR=            . 
     
    50625063ALL_CLASSES=    fileopentestbean/*.class 
    50635064 
    5064 include $(TWEEK_BASE_DIR)/share/tweek/tweek.appdefs.mk 
     5065DZR_BASE_DIR=   $(shell flagpoll doozer --get-prefix) 
     5066include $(DZR_BASE_DIR)/ext/tweek/dzr.tweek.mk 
    50655067 
    50665068# -------------------------------------------------------------- 
  • juggler/trunk/modules/tweek/test/BeanDeliveryTest/deliveryServer.cpp

    r18824 r19540  
    4747   try 
    4848   { 
    49       if ( mgr.init("delivery_test", argc, argv).success()
     49      if ( mgr.init("delivery_test", argc, argv)
    5050      { 
    51          vpr::ReturnStatus status
     51         bool status(false)
    5252 
    5353         // Once the CORBA Manager is initialized, we need to create the 
     
    5959            // If we were able to create the Subject Manager, now we register 
    6060            // our objects with it. 
    61             if ( status.success()
     61            if ( status
    6262            { 
    6363               tweek::BeanDeliverySubjectImpl* delivery_subject = 
     
    9797         } 
    9898 
    99          if ( ! status.success()
     99         if ( ! status
    100100         { 
    101101            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
  • juggler/trunk/modules/tweek/test/CxxClient/client.cpp

    r18824 r19540  
    122122   { 
    123123      // Attempt to initialize the CORBA Service. 
    124       if ( corba_service.init(argc, argv).success()
     124      if ( corba_service.init(argc, argv)
    125125      { 
    126126         // This will hold the reference to the Subject Manager we use. 
  • juggler/trunk/modules/tweek/test/CxxClient/server.cpp

    r18824 r19540  
    4343   try 
    4444   { 
    45       if ( mgr.init("cxx_client_test", argc, argv).success()
     45      if ( mgr.init("cxx_client_test", argc, argv)
    4646      { 
    47          vpr::ReturnStatus status
     47         bool status(false)
    4848 
    4949         // Once the CORBA Manager is initialized, we need to create a 
     
    5555            // If we were able to create the Subject Manager, now we register 
    5656            // our objects with it. 
    57             if ( status.success()
     57            if ( status
    5858            { 
    5959               // Add a test informational item to the Subject Manager. 
     
    9090         } 
    9191 
    92          if ( ! status.success()
     92         if ( ! status
    9393         { 
    9494            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
  • juggler/trunk/modules/tweek/test/NetworkTestBean/main.cpp

    r18824 r19540  
    5050   try 
    5151   { 
    52       if ( mgr.init("corba_test", argc, argv).success()
     52      if ( mgr.init("corba_test", argc, argv)
    5353      { 
    54          vpr::ReturnStatus status
     54         bool status(false)
    5555 
    5656         // Once the CORBA Manager is initialized, we need to create a 
     
    6363            // If we were able to create the Subject Manager, now we register 
    6464            // our objects with it. 
    65             if ( status.success()
     65            if ( status
    6666            { 
    6767               // Add a test informational item to the Subject Manager. 
     
    103103         } 
    104104 
    105          if ( ! status.success()
     105         if ( ! status
    106106         { 
    107107            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
  • juggler/trunk/modules/tweek/test/corba/main.cpp

    r18824 r19540  
    3737   try 
    3838   { 
    39       if ( mgr.init("corba_test", argc, argv).success()
     39      if ( mgr.init("corba_test", argc, argv)
    4040      { 
    41          vpr::ReturnStatus status
     41         bool status(false)
    4242 
    4343         try 
     
    5252         } 
    5353 
    54          if ( ! status.success()
     54         if ( ! status
    5555         { 
    5656            vprDEBUG(vprDBG_ALL, vprDBG_CRITICAL_LVL) 
  • juggler/trunk/modules/tweek/tweek/CORBA/CorbaManager.cpp

    r19335 r19540  
    7070} 
    7171 
    72 vpr::ReturnStatus CorbaManager::init(const std::string& local_id, int& argc, 
    73                                      char** argv, const std::string& nsHost, 
    74                                      const vpr::Uint16& nsPort, 
    75                                      const std::string& iiopVersion) 
    76 
    77    vpr::ReturnStatus status; 
     72bool CorbaManager::init(const std::string& local_id, int& argc, char** argv, 
     73                        const std::string& nsHost, const vpr::Uint16& nsPort, 
     74                        const std::string& iiopVersion) 
     75
     76   bool status(true); 
    7877 
    7978   // Retrieve the application name from argv if argv is non-NULL. 
     
    144143   catch (CORBA::SystemException& sysEx) 
    145144   { 
    146       status.setCode(vpr::ReturnStatus::Fail)
     145      status = false
    147146      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    148147         << "Caught CORBA::SystemException during initialization\n" 
     
    152151   catch (CORBA::Exception&) 
    153152   { 
    154       status.setCode(vpr::ReturnStatus::Fail)
     153      status = false
    155154      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    156155         << "Caught CORBA::Exception during initialization.\n" 
     
    160159   catch (omniORB::fatalException& fe) 
    161160   { 
    162       status.setCode(vpr::ReturnStatus::Fail)
     161      status = false
    163162      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    164163         << "Caught omniORB::fatalException:\n" << vprDEBUG_FLUSH; 
     
    173172   catch (vpr::Exception& ex) 
    174173   { 
    175       status.setCode(vpr::ReturnStatus::Fail)
     174      status = false
    176175      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    177176         << "Caught vpr::Exception during initialization.\n" 
     
    261260} 
    262261 
    263 vpr::ReturnStatus CorbaManager::createSubjectManager() 
     262bool CorbaManager::createSubjectManager() 
    264263{ 
    265264   vprASSERT(! CORBA::is_nil(mRootContext) && "No naming service available"); 
    266265   vprASSERT(! CORBA::is_nil(mLocalContext) && "No naming service available"); 
    267    vpr::ReturnStatus status
     266   bool status(true)
    268267 
    269268   tweek::SubjectManager_var mgr_ptr; 
     
    291290   { 
    292291      boost::ignore_unused_variable_warning(policy_ex); 
    293       status.setCode(vpr::ReturnStatus::Fail)
     292      status = false
    294293      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    295294         << "Invalid policy used when activating Subject Manager object\n" 
     
    300299   // we couldn't, there is no point in registering anything with the naming 
    301300   // service. 
    302    if ( status.success()
     301   if ( status
    303302   { 
    304303      // Try to add the mgr_ptr reference to the bound references known to the 
     
    368367      { 
    369368         boost::ignore_unused_variable_warning(ex); 
    370          status.setCode(vpr::ReturnStatus::Fail)
     369         status = false
    371370         vprDEBUG(vprDBG_ALL, vprDBG_WARNING_LVL) 
    372371            << "Unable to contact the naming service\n" << vprDEBUG_FLUSH; 
     
    374373      catch (CORBA::SystemException&) 
    375374      { 
    376          status.setCode(vpr::ReturnStatus::Fail)
     375         status = false
    377376         vprDEBUG(vprDBG_ALL, vprDBG_WARNING_LVL) 
    378377            << "Caught a CORBA::SystemException while using the naming service" 
     
    384383} 
    385384 
    386 vpr::ReturnStatus CorbaManager::destroySubjectManager() 
    387 { 
    388    vpr::ReturnStatus status
     385bool CorbaManager::destroySubjectManager() 
     386{ 
     387   bool status(false)
    389388 
    390389   // Only try to do destruction if there is a servant to destroy. 
     
    396395   else 
    397396   { 
    398       status.setCode(vpr::ReturnStatus::Fail)
     397      status = false
    399398      vprDEBUG(tweekDBG_CORBA, vprDBG_WARNING_LVL) 
    400399         << "WARNING: No Subject Manager servant to destroy!\n" 
     
    409408// ============================================================================ 
    410409 
    411 vpr::ReturnStatus CorbaManager::createChildPOA(const std::string& local_id) 
    412 { 
    413    vpr::ReturnStatus status
     410bool CorbaManager::createChildPOA(const std::string& local_id) 
     411{ 
     412   bool status(true)
    414413   CORBA::Object_var obj; 
    415414   CORBA::PolicyList policy_list; 
     
    455454   { 
    456455      boost::ignore_unused_variable_warning(ex); 
    457       status.setCode(vpr::ReturnStatus::Fail)
     456      status = false
    458457      vprDEBUG(vprDBG_ALL, vprDBG_WARNING_LVL) 
    459458         << "WARNING: Child POA named '" << poa_name << "' already exists!\n" 
     
    463462   { 
    464463      boost::ignore_unused_variable_warning(ex); 
    465       status.setCode(vpr::ReturnStatus::Fail)
     464      status = false
    466465      vprDEBUG(vprDBG_ALL, vprDBG_WARNING_LVL) 
    467466         << "WARNING: Failed to set IdUniquenessPolicy for child POA\n" 
  • juggler/trunk/modules/tweek/tweek/CORBA/CorbaManager.h

    r18824 r19540  
    3939 
    4040#include <vpr/Thread/Thread.h> 
    41 #include <vpr/Util/ReturnStatus.h> 
    4241 
    4342#include <tweek/CORBA/SubjectManagerImpl.h> 
     
    110109    *                    "1.2".  It defaults to "1.0". 
    111110    */ 
    112    vpr::ReturnStatus init(const std::string& localId, int& argc, char** argv, 
    113                           const std::string& nsHost = std::string(""), 
    114                           const vpr::Uint16& nsPort = vpr::Uint16(2809), 
    115                           const std::string& iiopVersion = std::string("1.0")); 
     111   bool init(const std::string& localId, int& argc, char** argv, 
     112             const std::string& nsHost = std::string(""), 
     113             const vpr::Uint16& nsPort = vpr::Uint16(2809), 
     114             const std::string& iiopVersion = std::string("1.0")); 
    116115 
    117116   /** 
     
    142141    * Binds the interface object. 
    143142    */ 
    144    vpr::ReturnStatus createSubjectManager(); 
     143   bool createSubjectManager(); 
    145144 
    146145   /** 
     
    151150    * successfully in createSubjectManager(). 
    152151    * 
    153     * @return vpr::ReturnStatus::Fail will be returned if the servant could not 
    154     *         be destroyed successfully. 
    155     */ 
    156    vpr::ReturnStatus destroySubjectManager(); 
     152    * @return \c false will be returned if the servant could not be 
     153    *         destroyed successfully. 
     154    */ 
     155   bool destroySubjectManager(); 
    157156 
    158157   /** 
     
    195194 
    196195private: 
    197    vpr::ReturnStatus createChildPOA(const std::string& local_id); 
     196   bool createChildPOA(const std::string& local_id); 
    198197 
    199198   std::string mAppName; 
  • juggler/trunk/modules/tweek/tweek/CORBA/SubjectManagerImpl.cpp

    r19362 r19540  
    9797} 
    9898 
    99 vpr::ReturnStatus SubjectManagerImpl::unregisterSubject(const char* name) 
    100    throw(CORBA::SystemException) 
    101 { 
    102    vpr::ReturnStatus status
     99bool SubjectManagerImpl::unregisterSubject(const char* name) 
     100   throw (CORBA::SystemException) 
     101{ 
     102   bool status(true)
    103103   std::string name_str(name); 
    104104   vpr::Guard<vpr::Mutex> guard(mSubjectsMutex); 
     
    122122         << " No subject registered under the name '" << name_str 
    123123         << "'\n" << vprDEBUG_FLUSH; 
    124       status.setCode(vpr::ReturnStatus::Fail)
     124      status = false
    125125   } 
    126126 
  • juggler/trunk/modules/tweek/tweek/CORBA/SubjectManagerImpl.h

    r18824 r19540  
    9494    *             registered subject. 
    9595    */ 
    96    vpr::ReturnStatus unregisterSubject(const char* name) 
    97       throw(CORBA::SystemException); 
     96   bool unregisterSubject(const char* name) throw (CORBA::SystemException); 
    9897 
    9998   /** 
  • juggler/trunk/modules/tweek/tweek/Client/CorbaService.cpp

    r19335 r19540  
    8585} 
    8686 
    87 vpr::ReturnStatus CorbaService::init(int& argc, char* argv[]) 
    88 { 
    89    vpr::ReturnStatus status
     87bool CorbaService::init(int& argc, char* argv[]) 
     88{ 
     89   bool status(true)
    9090 
    9191   try 
     
    130130   catch (CORBA::SystemException& sysEx) 
    131131   { 
    132       status.setCode(vpr::ReturnStatus::Fail)
     132      status = false
    133133      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    134134         << "Caught CORBA::SystemException during initialization\n" 
     
    138138   catch (CORBA::Exception&) 
    139139   { 
    140       status.setCode(vpr::ReturnStatus::Fail)
     140      status = false
    141141      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    142142         << "Caught CORBA::Exception during initialization.\n" 
     
    146146   catch (omniORB::fatalException& fe) 
    147147   { 
    148       status.setCode(vpr::ReturnStatus::Fail)
     148      status = false
    149149      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    150150         << "Caught omniORB::fatalException:\n" << vprDEBUG_FLUSH; 
     
    159159   catch (vpr::Exception& ex) 
    160160   { 
    161       status.setCode(vpr::ReturnStatus::Fail)
     161      status = false
    162162      vprDEBUG(tweekDBG_CORBA, vprDBG_CRITICAL_LVL) 
    163163         << "Caught vpr::Exception during initialization.\n" 
     
    274274} 
    275275 
    276 vpr::ReturnStatus CorbaService::initRootPOA() 
    277 { 
    278    vpr::ReturnStatus status
     276bool CorbaService::initRootPOA() 
     277{ 
     278   bool status(true)
    279279 
    280280   CORBA::Object_var obj; 
  • juggler/trunk/modules/tweek/tweek/Client/CorbaService.h

    r18824 r19540  
    8888   } 
    8989 
    90    vpr::ReturnStatus init(int& argc, char* argv[]); 
     90   bool init(int& argc, char* argv[]); 
    9191 
    9292   /** 
     
    190190 
    191191private: 
    192    vpr::ReturnStatus initRootPOA(); 
     192   bool initRootPOA(); 
    193193 
    194194   /**