C++ main module for gpm 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 
18 class CORE_VectorReader : public virtual CORE_Object {
19 
20  SP_OBJECT(CORE_VectorReader);
21  // ATTRIBUTES
22 
23 public:
24 
25 private:
26 
27 
28 
29 
30 
31 
32 protected:
33  // METHODS
34 
35  // CONSTRUCTORS
36 
39  CORE_VectorReader(void);
40 
41 
42 
43  // DESTRUCTORS
44 
45 
48  virtual ~CORE_VectorReader(void);
49 
50 
51 public:
52  // NEW method
53 
54 
55  // SET methods
56 
57 
58  // GET methods
59 
60 
61 
68  template<class T>
69  static tBoolean readVector(tString& str,vector<T>& vs);
70 
71 
72  inline static tBoolean readVector(const tString& str,tReal v[3]) {
73  tString s=str;
74  vector<tReal> vs;
75  tBoolean succeeds=readVector(s,vs);
76  int i,n=(vs.size()<3)?vs.size():3;
77  for (i=0;i<n;i++) v[i]=vs[i];
78  for (i=n;i<3;i++) v[i]=0;
79  return succeeds;
80  }
81 
82 
83 };
84 #include "CORE_VectorReader.hpp"
85 
86 #endif
virtual ~CORE_VectorReader(void)
destroy
Definition: CORE_VectorReader.cpp:14
This class describes a reader for vector value.
Definition: CORE_VectorReader.h:18
#define tBoolean
Definition: types.h:35
CORE_VectorReader(void)
create
Definition: CORE_VectorReader.cpp:10
static tBoolean readVector(tString &str, vector< T > &vs)
read vector of string v v=[x,y,z,t] or x,y,z,t
Definition: CORE_VectorReader.hpp:7
abstract base class for most classes.
Definition: CORE_Object.h:30
#define tString
Definition: types.h:36
static tBoolean readVector(const tString &str, tReal v[3])
Definition: CORE_VectorReader.h:72
#define tReal
Definition: types.h:18
DEFINE_SPTR(CORE_VectorReader)