39 for (it = possibleTypes.begin(); it < possibleTypes.end(); ++it)
60 possibleTypes.clear();
62 for (i = 0; i <
n; i++)
66 possibleTypes.push_back(aux);
86 possibleTypes.clear();
104 if (selection >= possibleTypes.size())
107 return possibleTypes[selection];
115 size_t i,
n = possibleTypes.size();
117 for (i = 0; i <
n; i++)
122 selection = (
unsigned int)i;
129 "Type '%s' is not one of the posibilities",
type.c_str());
136 std::vector<std::string>& outPosibilities)
const 138 outPosibilities = possibleTypes;
146 return !strcmp(possibleTypes[selection].c_str(),
type);
154 return !strcmp(possibleTypes[selection].c_str(),
type.c_str());
162 size_t n = possibleTypes.size();
163 for (
size_t i = 0; i <
n; i++)
void setType(const std::string &type)
Sets the currently selected type.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
virtual ~CTypeSelector()
Destructor.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
The virtual base class which provides a unified interface for all persistent objects in MRPT...
#define IMPLEMENTS_SERIALIZABLE(class_name, base, NameSpace)
This must be inserted in all CSerializable classes implementation files.
#define THROW_EXCEPTION(msg)
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
int checkTypeIndex(const std::string &type) const
Returns the index of a given type within the list of all possible types, or -1 if the given string is...
CTypeSelector(std::string posibilitiesList="", std::string defaultType="")
Default constructor.
const Scalar * const_iterator
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(__V)
For use in CSerializable implementations.
void readFromStream(mrpt::utils::CStream &in, int version) override
Introduces a pure virtual method responsible for loading from a CStream This can not be used directly...
bool isType(const char *type) const
Fast check for a given type, returns true if the selection is exactly the specified type name...
GLsizei const GLchar ** string
std::string getType() const
Gets the currently selected type, from the set of posibilities.
void tokenize(const std::string &inString, const std::string &inDelimiters, std::deque< std::string > &outTokens, bool skipBlankTokens=true) noexcept
Tokenizes a string according to a set of delimiting characters.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void getTypePosibilities(std::vector< std::string > &outPosibilities) const
Returns the set of posibilities in the "type" represented by this class.
This class represents a std::string derived class which is also CSerializable.
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
unsigned __int32 uint32_t
GLuint GLuint GLsizei GLenum type
int _strcmpi(const char *str1, const char *str2) noexcept
An OS-independent version of strcmpi.