INTRODUCTION
Overview
Download and Install
Quick Start
Documentation
Publications

NONFRAMEWORK CODE
Driver Interfaces
Drivers
Libraries
Utilities

FRAMEWORK CODE
Interfaces
Components
Libraries
Utilities

Full Software Listings

DEVELOPER
Tutorials
Examples
Dev Guide
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

proputils.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2009 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_PROPERTY_UTILITIES_H
00012 #define ORCAICE_PROPERTY_UTILITIES_H
00013 
00014 #include <vector>
00015 #include <string>
00016 #include <Ice/Properties.h>
00017 
00018 namespace orcaice
00019 {
00020 
00025 
00026 //
00027 // These guys are supposed to be simple wrappers for the Ice 'getPropertyXxxx' functions.
00028 //
00029 // In fact, things are a bit harder.  Ice's 'getPropertAsInt' returns '0' for 'property not found'.
00030 // So everything goes through Ice's 'getProperty' instead, which returns an empty string on 'not found'.
00031 //
00032 
00038 bool isPropertyNotNull( const Ice::PropertiesPtr &, const ::std::string& key );
00039 
00042 void ensurePropertyNotNull( const Ice::PropertiesPtr &, const std::string& key );
00043 
00047 int getProperty( const Ice::PropertiesPtr &, const std::string& key, std::string &value );
00049 std::string getPropertyWithDefault( const Ice::PropertiesPtr &, const std::string& key, const std::string &defaultValue );
00050 
00053 int getPropertyAsInt( const Ice::PropertiesPtr &, const std::string& key, int &value );
00056 int getPropertyAsIntWithDefault( const Ice::PropertiesPtr &, const std::string& key, int defaultValue );
00057 
00060 int getPropertyAsDouble( const Ice::PropertiesPtr &, const std::string& key, double &value );
00063 double getPropertyAsDoubleWithDefault( const Ice::PropertiesPtr &, const std::string& key, double defaultValue );
00064 
00067 int getPropertyAsStringVector( const Ice::PropertiesPtr &, const std::string& key, std::vector<std::string> &value, char delim=':' );
00069 std::vector<std::string> 
00070 getPropertyAsStringVectorWithDefault( const Ice::PropertiesPtr &, const std::string& key, const std::vector<std::string>& defaultValue, char delim=':' );
00071 
00078 int getPropertyAsIntVector( const Ice::PropertiesPtr &, const std::string& key, std::vector<int> &value );
00080 std::vector<int> 
00081 getPropertyAsIntVectorWithDefault( const Ice::PropertiesPtr &, const std::string& key, const std::vector<int> &defaultValue );
00082 
00089 int getPropertyAsDoubleVector( const Ice::PropertiesPtr &, const std::string& key, std::vector<double> &value );
00093 std::vector<double> 
00094 getPropertyAsDoubleVectorWithDefault( const Ice::PropertiesPtr &, const std::string& key, const std::vector<double> &defaultValue );
00095 
00098 std::string warnMissingProperty( const std::string & key, bool fatal=false );
00101 std::string warnMissingPropertyWithDefault( const std::string & key, const std::string & defaultValue );
00102 
00106 std::string warnMissingProperty( const std::string & info, const std::string & prop, bool fatal=false );
00110 std::string warnMissingPropertyWithDefault( const std::string & info, const std::string & prop, const std::string & defaultValue );
00111 
00113 
00114 } // namespace
00115 
00116 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5