openrave.org

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
OpenRAVE::utils Namespace Reference

Classes

struct  null_deleter
 
struct  index_cmp
 
struct  smart_pointer_deleter
 allow to add different custom deleter funtions to a shared_ptr without touching its original custom deleter More...
 

Functions

void GetWallTime (uint32_t &sec, uint32_t &nsec)
 
uint64_t GetNanoTime ()
 
uint64_t GetMicroTime ()
 
uint32_t GetMilliTime ()
 
static uint64_t GetNanoPerformanceTime ()
 
template<class T >
boost::shared_ptr< T > sptr_from (boost::weak_ptr< T > const &wpt)
 
std::string ConvertToLowerCase (const std::string &s)
 returns a lower case version of the string
 
template<typename C >
void TokenizeString (std::string const &s, char const *d, C &ret)
 separates the directories from a string and returns them in a vector
 
OPENRAVE_API std::string GetFilenameUntilSeparator (std::istream &sinput, char separator)
 gets the string up the next separator and strips it of leading whitespace.
 
OPENRAVE_API std::string & SearchAndReplace (std::string &out, const std::string &in, const std::vector< std::pair< std::string, std::string > > &pairs)
 search and replace strings for all pairs. Internally first checks the longest strings before the shortest
 
OPENRAVE_API std::string GetMD5HashString (const std::string &s)
 compute the md5 hash of a string
 
OPENRAVE_API std::string GetMD5HashString (const std::vector< uint8_t > &v)
 compute the md5 hash of an array
 
template<class T >
ClampOnRange (T value, T min, T max)
 
template<typename T >
NormalizeCircularAngle (T theta, T min, T max)
 
template<typename T >
SubtractCircularAngle (T f0, T f1)
 
template<typename T >
InterpolateCircularAngle (T start, T end, T fraction, T lowerLimit, T upperLimit)
 
template<typename T >
Sqr (T t)
 
bool IsValidCharInName (char c)
 openrave valid characters to be used in names
 
bool IsValidName (const std::string &s)
 openrave valid characters to be used in names
 
std::string ConvertToOpenRAVEName (const std::string &name)
 converts improper characters to _ so the entire name is valid
 
bool PairStringLengthCompare (const std::pair< std::string, std::string > &p0, const std::pair< std::string, std::string > &p1)
 

Function Documentation

template<class T >
T OpenRAVE::utils::ClampOnRange ( value,
min,
max 
)
inline

Definition at line 264 of file utils.h.

std::string OpenRAVE::utils::ConvertToLowerCase ( const std::string &  s)
inline

returns a lower case version of the string

Definition at line 196 of file utils.h.

std::string OpenRAVE::utils::ConvertToOpenRAVEName ( const std::string &  name)
inline

converts improper characters to _ so the entire name is valid

Definition at line 329 of file utils.h.

std::string OpenRAVE::utils::GetFilenameUntilSeparator ( std::istream &  sinput,
char  separator 
)

gets the string up the next separator and strips it of leading whitespace.

If separator is not present, will return entire string

Definition at line 105 of file utils.cpp.

std::string OpenRAVE::utils::GetMD5HashString ( const std::string &  s)

compute the md5 hash of a string

Definition at line 25 of file utils.cpp.

std::string OpenRAVE::utils::GetMD5HashString ( const std::vector< uint8_t > &  v)

compute the md5 hash of an array

Definition at line 47 of file utils.cpp.

uint64_t OpenRAVE::utils::GetMicroTime ( )
inline

Definition at line 110 of file utils.h.

uint32_t OpenRAVE::utils::GetMilliTime ( )
inline
Examples:
orikfilter.cpp.

Definition at line 117 of file utils.h.

static uint64_t OpenRAVE::utils::GetNanoPerformanceTime ( )
inlinestatic

Definition at line 124 of file utils.h.

uint64_t OpenRAVE::utils::GetNanoTime ( )
inline

Definition at line 103 of file utils.h.

void OpenRAVE::utils::GetWallTime ( uint32_t &  sec,
uint32_t &  nsec 
)
inline

Definition at line 88 of file utils.h.

template<typename T >
T OpenRAVE::utils::InterpolateCircularAngle ( start,
end,
fraction,
lowerLimit,
upperLimit 
)
inline

Definition at line 305 of file utils.h.

bool OpenRAVE::utils::IsValidCharInName ( char  c)
inline

openrave valid characters to be used in names

Definition at line 316 of file utils.h.

bool OpenRAVE::utils::IsValidName ( const std::string &  s)
inline

openrave valid characters to be used in names

Definition at line 321 of file utils.h.

template<typename T >
T OpenRAVE::utils::NormalizeCircularAngle ( theta,
min,
max 
)
inline

Definition at line 276 of file utils.h.

bool OpenRAVE::utils::PairStringLengthCompare ( const std::pair< std::string, std::string > &  p0,
const std::pair< std::string, std::string > &  p1 
)

Definition at line 69 of file utils.cpp.

std::string & OpenRAVE::utils::SearchAndReplace ( std::string &  out,
const std::string &  in,
const std::vector< std::pair< std::string, std::string > > &  pairs 
)

search and replace strings for all pairs. Internally first checks the longest strings before the shortest

Returns
returns a reference to the out string

Definition at line 74 of file utils.cpp.

template<class T >
boost::shared_ptr<T> OpenRAVE::utils::sptr_from ( boost::weak_ptr< T > const &  wpt)

Definition at line 146 of file utils.h.

template<typename T >
T OpenRAVE::utils::Sqr ( t)
inline

Definition at line 311 of file utils.h.

template<typename T >
T OpenRAVE::utils::SubtractCircularAngle ( f0,
f1 
)
inline

Definition at line 298 of file utils.h.

template<typename C >
void OpenRAVE::utils::TokenizeString ( std::string const &  s,
char const *  d,
C &  ret 
)
inline

separates the directories from a string and returns them in a vector

from http://stackoverflow.com/questions/5505965/fast-string-splitting-with-multiple-delimiters

Usage:

std::vector<std::string> vstrings;
TokenizeString("0.141 0.51411", " \n\t", vstrings);
// store begin and end positions (~8x faster)
typedef boost::iterator_range< std::string::const_iterator > string_view;
std::vector<string_view> vsv;
TokenizeString("0.141 0.51411", " \n\t", vsv);

Definition at line 220 of file utils.h.