C++ main module for emicrom Package  1.0
CORE_VectorReader.h
Go to the documentation of this file.
1 #ifndef CORE_VectorReader_H
2 #define CORE_VectorReader_H
3 
4 #include "CORE_Object.h"
5 #include "CORE_Array.h"
6 
19 class CORE_VectorReader : public virtual CORE_Object {
20 
22  // ATTRIBUTES
23 
24 public:
25 
26 private:
27 
28 
29 
30 
31 
32 
33 protected:
34  // METHODS
35 
36  // CONSTRUCTORS
37 
40  CORE_VectorReader(void);
41 
42 
43 
44  // DESTRUCTORS
45 
46 
49  virtual ~CORE_VectorReader(void);
50 
51 
52 public:
53  // NEW method
54 
55 
56  // SET methods
57 
58 
59  // GET methods
60 
61 
62 
69  template<class T>
70  static tBoolean readVector(tString& str,vector<T>& vs);
77  template<class T>
78  static tBoolean readVector(tString& str,CORE_Array<T>& vs);
79 
80 
87  inline static tBoolean readVector(const tString& str,tReal v[3]) {
88  tString s=str;
89  vector<tReal> vs;
90  tBoolean succeeds=readVector(s,vs);
91  tUIndex i,n=(vs.size()<3)?vs.size():3;
92  for (i=0;i<n;i++) v[i]=vs[i];
93  for (i=n;i<3;i++) v[i]=0;
94  return succeeds;
95  }
96 
97 
98 };
99 #include "CORE_VectorReader.hpp"
100 
101 #endif
virtual ~CORE_VectorReader(void)
destroy
Definition: CORE_VectorReader.cpp:14
This class describes a reader for vector value.
Definition: CORE_VectorReader.h:19
#define tBoolean
Definition: types.h:139
CORE_VectorReader(void)
create
Definition: CORE_VectorReader.cpp:10
static tBoolean readVector(tString &str, vector< T > &vs)
read vector of string str v=[x,y,z,t] or x,y,z,t
Definition: CORE_VectorReader.hpp:7
this class describes an array
Definition: CORE_Array.h:19
#define tUIndex
Definition: types.h:126
SP_OBJECT(CORE_VectorReader)
abstract base class for most classes.
Definition: CORE_Object.h:53
#define tString
Definition: types.h:135
static tBoolean readVector(const tString &str, tReal v[3])
read vector of string str v=[x,y,z,t] or x,y,z,t
Definition: CORE_VectorReader.h:87
#define tReal
Definition: types.h:118
DEFINE_SPTR(CORE_VectorReader)