orca-robotics


INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

REPOSITORY
Interfaces
Components
Libraries
Utilities
Software Map

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard
Wiki
login/pass: orca/orca

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

privateutils.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This copy of Orca is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef ORCAICE_PRIVATE_UTILITIES_H
00012 #define ORCAICE_PRIVATE_UTILITIES_H
00013 
00014 // include defnition of Ice runtime
00015 #include <Ice/Ice.h>
00016 #include <string>
00017 
00018 #include <orca/orca.h>
00019 
00020 //  This file contains only internal functions used inside libOrcaIce
00021 //  Don't make Doxygen tags so these functions are not included in the public documentation.
00022 
00023 namespace orcaice
00024 {
00025 class Component;
00026 namespace detail
00027 {
00028 
00029     // Transfer a property from one property set to another
00030     // returns:
00031     //  0 if it was transferred successfully
00032     //  1 if the property already existed in the target set and it was left untouched
00033     // -1 if the property was not set in the source set, the target was left untouched
00034     int 
00035     transferProperty( const Ice::PropertiesPtr &fromProperties, 
00036                       Ice::PropertiesPtr       &toProperties,
00037                       const std::string        &fromKey,
00038                       const std::string        &toKey,
00039                       bool                      force );
00040 
00041     // Transfer a property from one property set to another
00042     // returns:
00043     //  0 if it was transferred successfully
00044     //  1 if the property already existed in the target set and it was left untouched
00045     int
00046     transferProperty( Ice::PropertiesPtr& toProperties,
00047                       const std::string&  fromKey,
00048                       const std::string&  fromValue,
00049                       const std::string&  toKey,
00050                       bool                force );
00051 
00052     // Internal helper function.
00053     // behaves like transferProperty. if key is missing, sets the toValue to defaultValue.
00054     void transferPropertyWithDefault( const Ice::PropertiesPtr &fromProperties,
00055                                       Ice::PropertiesPtr       &toProperties,
00056                                       const std::string        &fromKey,
00057                                       const std::string        &toKey,
00058                                       const std::string        &defaultValue,
00059                                       bool                      force );
00060 
00061     void setFactoryProperties( Ice::PropertiesPtr &properties, const std::string &compTag );
00062 
00063     // throws gbxsickacfr::gbxutilacfr::Exception if can't load the file
00064     void setGlobalProperties( Ice::PropertiesPtr & properties, const std::string & filename );
00065 
00066     // throws gbxsickacfr::gbxutilacfr::Exception if can't load the file
00067     void setComponentPropertiesFromFile( Ice::PropertiesPtr & properties, const std::string & filename );
00068 
00069     /*
00070      *   Sets the ComponentName parameter.
00071      *   Replaces special platform 'local' with host name.
00072      *   Combines platform and component names into adapter ID.
00073      *
00074      *   The default for IceStorm server location assumes that one is running
00075      *   on our host at port 10000.
00076      *
00077      *   @note Cannot use Current structure because the component is not fully initialized yet.
00078      */
00079     orca::FQComponentName parseComponentProperties( const Ice::CommunicatorPtr &communicator,
00080                                                     const std::string &compTag );
00081 
00082     // Prints out all component properties. Tag is used only for tracing.
00083     void printComponentProperties( const Ice::PropertiesPtr &properties, const std::string &compTag );
00084 
00085     // Prints Ice, Orca, and (if not empty) Project version.
00086     // Project version is obatained from the component, this allows for non-orca projects
00087     void printAllVersions( const Component& component );
00088 
00089     // Use for 'Application's:
00090     // adds to the set of properties by reading from the component's config file
00091     void addPropertiesFromApplicationConfigFile( Ice::PropertiesPtr   &properties,
00092                                                  const Ice::StringSeq &commandLineArgs,
00093                                                  const std::string    &componentTag );
00094 
00095     // Use for 'Service's:
00096     // adds to the set of properties by reading from the component's config file
00097     void addPropertiesFromServiceConfigFile( Ice::PropertiesPtr   &properties,
00098                                              const Ice::StringSeq &commandLineArgs,
00099                                              const std::string    &componentTag );
00100 
00101     // adds to the set of properties by reading from the global config file
00102     void addPropertiesFromGlobalConfigFile( Ice::PropertiesPtr   &properties,
00103                                             const std::string    &componentTag );
00104 
00105 } // namespace
00106 } // namespace
00107 
00108 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5