Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
RangeList.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_CORE_RANGE_LIST_H__
13 #define __KOME_CORE_RANGE_LIST_H__
14 
15 
16 #include <vector>
17 #include <utility>
18 
19 
20 namespace kome {
21  namespace core {
22 
27  class CORE_TOOLKITS_CLASS RangeList {
28  public:
33  typedef enum {
34  DEFAULT_NONE,
35  DEFAULT_ALL
36  } DefaultType;
37 
38  public:
43  RangeList( const DefaultType type = DEFAULT_NONE );
44 
49  virtual ~RangeList();
50 
51  protected:
54 
55  protected:
60  union NumberValue {
61  int intVal;
62  double dblVal;
63  };
64 
66  std::vector< std::pair< NumberValue, NumberValue > > m_ranges;
67 
68  public:
75  void addIntRange( const int start, const int end );
76 
83  void addDoubleRange( const double start, const double end );
84 
89  void clearRanges();
90 
96  unsigned int getNumberOfRanges();
97 
104  int getStartInt( const unsigned int idx );
105 
112  int getEndInt( const unsigned int idx );
113 
120  double getStartDouble( const unsigned int idx );
121 
128  double getEndDouble( const unsigned int idx );
129 
130  public:
137  bool checkIntValue( const int val );
138 
145  bool checkDoubleValue( const double val );
146 
147  public:
153  void importIntRanges( const char* str );
154 
160  void importDoubleRanges( const char* str );
161 
167  std::string exportIntRanges();
168 
174  std::string exportDoubleRanges();
175 
176  public:
182  DefaultType getType();
183  };
184  }
185 }
186 
187 
188 #endif // __KOME_CORE_RANGE_LIST_H__
DefaultType m_type
Definition: RangeList.h:53
range list mangement class
Definition: RangeList.h:27
DefaultType
default type
Definition: RangeList.h:33
std::vector< std::pair< NumberValue, NumberValue > > m_ranges
Definition: RangeList.h:66