Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9406 in orxonox.OLD for trunk/src/lib/util


Ignore:
Timestamp:
Jul 24, 2006, 11:09:47 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy back

merged with commandsvn merge -r9346:HEAD https://svn.orxonox.net/orxonox/branches/proxy .

no conflicts

Location:
trunk/src/lib/util
Files:
2 deleted
13 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/util/Makefile.am

    r8724 r9406  
    66libORXlibutil_a_SOURCES = \
    77                substring.cc \
    8                 tokenizer.cc \
    98                color.cc \
    109                helper_functions.cc \
     
    2423                filesys/file.cc \
    2524                filesys/directory.cc \
     25                filesys/net_link.cc \
    2626                \
    2727                preferences.cc \
     
    3232noinst_HEADERS = \
    3333                substring.h \
    34                 tokenizer.h \
    3534                multi_type.h \
    3635                color.h \
     
    4443                filesys/file.h \
    4544                filesys/directory.h \
     45                filesys/net_link.h \
    4646                \
    4747                preferences.h \
  • trunk/src/lib/util/executor/executor_functional.h

    r8271 r9406  
    179179  {
    180180    (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(
    181       fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) );
     181      (sub.size() > 0) ? fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) : (fromMulti<type0>(this->defaultValue[0])));
    182182  };
    183183
     
    222222  {
    223223    (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(
    224       fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)),
    225       fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)));
     224      (sub.size() > 0) ? fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) : (fromMulti<type0>(this->defaultValue[0])),
     225      (sub.size() > 1) ? fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)) : (fromMulti<type1>(this->defaultValue[1])));
    226226  };
    227227
     
    276276  {
    277277    (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(
    278       fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)),
    279       fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)),
    280       fromString<type2>(sub[2], getDefault<type2>(this->defaultValue, 2)));
     278      (sub.size() > 0) ? fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) : (fromMulti<type0>(this->defaultValue[0])),
     279      (sub.size() > 1) ? fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)) : (fromMulti<type1>(this->defaultValue[1])),
     280      (sub.size() > 2) ? fromString<type2>(sub[2], getDefault<type2>(this->defaultValue, 2)) : (fromMulti<type2>(this->defaultValue[2])));
    281281  };
    282282
     
    333333  {
    334334    (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(
    335       fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)),
    336       fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)),
    337       fromString<type2>(sub[2], getDefault<type2>(this->defaultValue, 2)),
    338       fromString<type3>(sub[3], getDefault<type3>(this->defaultValue, 3)));
     335      (sub.size() > 0) ? fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) : (fromMulti<type0>(this->defaultValue[0])),
     336      (sub.size() > 1) ? fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)) : (fromMulti<type1>(this->defaultValue[1])),
     337      (sub.size() > 2) ? fromString<type2>(sub[2], getDefault<type2>(this->defaultValue, 2)) : (fromMulti<type2>(this->defaultValue[2])),
     338      (sub.size() > 3) ? fromString<type3>(sub[3], getDefault<type3>(this->defaultValue, 3)) : (fromMulti<type3>(this->defaultValue[3])));
    339339  };
    340340
     
    392392  {
    393393    (__EXECUTOR_FUNCTIONAL_FUNCTION_EXEC)(
    394       fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)),
    395       fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)),
    396       fromString<type2>(sub[2], getDefault<type2>(this->defaultValue, 2)),
    397       fromString<type3>(sub[3], getDefault<type3>(this->defaultValue, 3)),
    398       fromString<type4>(sub[4], getDefault<type4>(this->defaultValue, 4)));
     394      (sub.size() > 0) ? fromString<type0>(sub[0], getDefault<type0>(this->defaultValue, 0)) : (fromMulti<type0>(this->defaultValue[0])),
     395      (sub.size() > 1) ? fromString<type1>(sub[1], getDefault<type1>(this->defaultValue, 1)) : (fromMulti<type1>(this->defaultValue[1])),
     396      (sub.size() > 2) ? fromString<type2>(sub[2], getDefault<type2>(this->defaultValue, 2)) : (fromMulti<type2>(this->defaultValue[2])),
     397      (sub.size() > 3) ? fromString<type3>(sub[3], getDefault<type3>(this->defaultValue, 3)) : (fromMulti<type3>(this->defaultValue[3])),
     398      (sub.size() > 4) ? fromString<type4>(sub[4], getDefault<type4>(this->defaultValue, 4)) : (fromMulti<type4>(this->defaultValue[4])));
    399399  };
    400400
  • trunk/src/lib/util/executor/functor_list.h

    r8894 r9406  
    135135
    136136  //! mixed values:
     137  FUNCTOR_LIST(2)(l_STRING, l_INT);
    137138  FUNCTOR_LIST(2)(l_STRING, l_FLOAT);
    138139  FUNCTOR_LIST(2)(l_UINT, l_LONG);
  • trunk/src/lib/util/helper_functions.cc

    r7714 r9406  
    1919#include "stdlibincl.h"
    2020
    21 using namespace std;
     21
    2222
    2323/**
  • trunk/src/lib/util/loading/dynamic_loader.cc

    r8362 r9406  
    2323
    2424
    25 using namespace std;
     25
    2626
    2727
  • trunk/src/lib/util/loading/factory.cc

    r8362 r9406  
    1919//#include "shell_command.h"
    2020
    21 using namespace std;
     21
    2222
    2323//SHELL_COMMAND(create, Factory, fabricate);
     
    117117  if (factory != Factory::factoryList->end())
    118118  {
    119     PRINTF(2)("Create a new Object of type %s\n", (*factory)->getName());
     119    PRINTF(2)("Create a new Object of type %s\n", (*factory)->getCName());
    120120    return (*factory)->fabricateObject(root);
    121121  }
     
    145145  if (factory != Factory::factoryList->end())
    146146  {
    147     PRINTF(4)("Create a new Object of type %s\n", (*factory)->getName());
     147    PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
    148148    return (*factory)->fabricateObject(NULL);
    149149  }
     
    173173  if (factory != Factory::factoryList->end())
    174174  {
    175     PRINTF(4)("Create a new Object of type %s\n", (*factory)->getName());
     175    PRINTF(4)("Create a new Object of type %s\n", (*factory)->getCName());
    176176    return (*factory)->fabricateObject(NULL);
    177177  }
  • trunk/src/lib/util/loading/load_param.cc

    r8408 r9406  
    6565          ((this->executor->getType() & Executor_NoLoadString) == Executor_NoLoadString)))
    6666    {
    67       PRINTF(4)("Loading value '%s' with Parameters '%s' onto: %s::%s\n", this->paramName.c_str(), loadString.c_str(), this->object->getClassName(), this->object->getName());
     67      PRINTF(4)("Loading value '%s' with Parameters '%s' onto: %s::%s\n", this->paramName.c_str(), loadString.c_str(), this->object->getClassCName(), this->object->getCName());
    6868      (*this->executor)(this->object, SubString(loadString, ",", SubString::WhiteSpaces, false, '\\'));
    6969    }
     
    164164{
    165165    // locating the class
    166     this->classDesc = LoadClassDescription::addClass(object->getClassName());
     166    this->classDesc = LoadClassDescription::addClass(object->getClassCName());
    167167
    168168    if ((this->paramDesc = this->classDesc->addParam(paramName)) != NULL)
  • trunk/src/lib/util/loading/resource.cc

    r8271 r9406  
    1818#include "resource.h"
    1919
    20 using namespace std;
     20
    2121
    2222
  • trunk/src/lib/util/loading/resource_manager.cc

    r8724 r9406  
    5050#include <unistd.h>
    5151
    52 using namespace std;
     52
    5353
    5454/**
  • trunk/src/lib/util/multi_type.cc

    r8316 r9406  
    1818#include "multi_type.h"
    1919
    20 //#include "stdincl.h"
    21 #include <stddef.h>
    22 #include <stdlib.h>
    23 #include <string.h>
    24 #include <stdio.h>
    2520#include <sstream>
    2621
     
    2823#include "debug.h"
    2924#endif
    30 
    31 using namespace std;
    3225
    3326/**
  • trunk/src/lib/util/substring.cc

    r7477 r9406  
    2828#include "substring.h"
    2929
    30 #include <string.h>
    31 #include <cassert>
    32 
    33 
    3430/**
    3531 * @brief default constructor
     
    108104
    109105/** @brief An empty String */
    110 const std::string SubString::emptyString = "";
     106// const std::string SubString::emptyString = "";
    111107/** @brief Helper that gets you a String consisting of all White Spaces */
    112108const std::string SubString::WhiteSpaces = " \n\t";
     
    238234  }
    239235  else
    240     return SubString::emptyString;
     236  {
     237    static std::string empty;
     238    return empty;
     239  }
    241240}
    242241
     
    250249 * SubString::SubString(const SubString& subString, unsigned int subSetBegin)
    251250 */
    252 SubString SubString::getSubSet(unsigned int subSetBegin) const
     251SubString SubString::subSet(unsigned int subSetBegin) const
    253252{
    254253  return SubString(*this, subSetBegin);
     
    265264 * SubString::SubString(const SubString& subString, unsigned int subSetBegin)
    266265 */
    267 SubString SubString::getSubSet(unsigned int subSetBegin, unsigned int subSetEnd) const
     266SubString SubString::subSet(unsigned int subSetBegin, unsigned int subSetEnd) const
    268267{
    269268  return SubString(*this, subSetBegin, subSetEnd);
     
    289288 * Supports delimiters, escape characters,
    290289 * ignores special  characters between safemode_char and between comment_char and linend '\n'.
    291  *
    292  *
    293290 */
    294291SubString::SPLIT_LINE_STATE
  • trunk/src/lib/util/substring.h

    r8408 r9406  
    22 * @file substring.h
    33 * @brief a small class to get the parts of a string separated by commas
     4 *
     5 * This class is also identified as a Tokenizer. It splits up one long
     6 * String into multiple small ones by a designated Delimiter.
     7 *
     8 * Substring is Advanced, and it is possible, to split a string by ','
     9 * but also removing leading and trailing spaces around the comma.
     10 *
     11 * @example
     12 * Split the String std::string st = "1345, The new empire   , is , orxonox"
     13 * is splitted with:
     14 * SubString(st, ',', " \n\t")
     15 * into
     16 * "1345", "The new empire", "is", "orxonox"
     17 * As you can see, the useless spaces around ',' were removed.
    418 */
    519
    6 #ifndef _SUBSTRING_H
    7 #define _SUBSTRING_H
     20#ifndef __SUBSTRING_H__
     21#define __SUBSTRING_H__
    822
    923#include <vector>
     
    6175
    6276  // retrieve a SubSet from the String
    63   SubString getSubSet(unsigned int subSetBegin) const;
    64   SubString getSubSet(unsigned int subSetBegin, unsigned int subSetEnd) const;
     77  SubString subSet(unsigned int subSetBegin) const;
     78  SubString subSet(unsigned int subSetBegin, unsigned int subSetEnd) const;
    6579
    6680  // retrieve Information from within
     
    7084  inline unsigned int size() const { return this->strings.size(); };
    7185  /** @param i the i'th String @returns the i'th string from the subset of Strings */
    72   inline const std::string& operator[](unsigned int i) const { return (i < this->strings.size()) ? this->strings[i] : emptyString; };
     86  inline const std::string& operator[](unsigned int i) const { return this->strings[i]; };
    7387  /** @param i the i'th String @returns the i'th string from the subset of Strings */
    7488  inline const std::string& getString(unsigned int i) const { return (*this)[i]; };
     89  /** @returns the front of the StringList. */
     90  inline const std::string& front() const { return this->strings.front(); };
     91  /** @returns the back of the StringList. */
     92  inline const std::string& back() const { return this->strings.back(); };
     93  /** @brief removes the back of the strings list. */
     94  inline void pop_back() { this->strings.pop_back(); };
    7595
    7696  // the almighty algorithm.
     
    93113private:
    94114  std::vector<std::string>  strings;                      //!< strings produced from a single string splitted in multiple strings
    95 
    96   static const std::string emptyString;
    97115};
    98116
    99 #endif /* _SUBSTRING_H */
     117#endif /* __SUBSTRING_H__ */
  • trunk/src/lib/util/threading.cc

    r7847 r9406  
    1818#include "threading.h"
    1919
    20 using namespace std;
     20
    2121
    2222namespace OrxThread
Note: See TracChangeset for help on using the changeset viewer.