SADB-Client  0.99
Situational Awareness Database
 All Classes Functions Variables
BlackboardObject.h
1 #ifndef __BlackboardObject__
2 #define __BlackboardObject__
3 
4 class Blackboard;
5 
7  public:
8  BlackboardObject(void);
9  ~BlackboardObject(void);
10  void Initialize(void);
11  void Free(void);
12 
13  //Generalized Constructor (planned)
14  void Create(Blackboard * board,const char * name);
15  void Create(Blackboard * board,const char * name,const char * description);
16  void Create(Blackboard * board,const char * name,const char * description,enum BODataType type);
17  void Create(Blackboard * board,const char * name,enum BODataType);
18 
19  //SADB Interface functions
20  void SetBlackboard(Blackboard * board);
21  void AddToBlackboard(void);
22  int Send(void);
23 
24  void AddToCategory(SADBu64 CUID);
25  void AddToCategory(const char * Cat);
26  void RemoveFromCategory(SADBu64 CUID);
27  void RemoveFromCategory(const char * Cat);
28 
29  void CreateIfNonExistant(const char * name);
30 
31  void GetByName(const char * name);
32  int GetLatestValue(void);
33  int GetValueAtNearestTimestamp(Timestamp * Time);
34  int GetValueAtTimestampNoInterpolation(Timestamp * Time);
35  int GetValueAtTimestamp(Timestamp * Time);
36  int GetValueAtTimestamp(Timestamp * Time,int Interpolation);
37  int GetValueAtTimestamp(Timestamp * Time,int Interpolation,int nPoints);
38  int GetValueAtNextTimestamp(Timestamp * Time);
39  int GetValueAtPreviousTimestamp(Timestamp * Time);
40 
41  int GetLatestTimestamp(Timestamp * Time);
42  int GetPreviousTimestamp(Timestamp * Current,Timestamp*Previous);
43  int GetNextTimestamp(Timestamp * Current,Timestamp*Next);
44  int GetNearestTimestamp(Timestamp * Target,Timestamp*Result);
45 
46  void SetDataType(enum BODataType);
47 
48  int SetDimensionsf(SADBu32 D,...);
49  int OnlySetDimensionsf(SADBu32 D,...);
50  int SetDimensions(SADBu32 D,SADBu32*Ds);
51  SADBu32 GetDimension(SADBu32 D);
52 
53  int SetName(const char * name);
54  void GetName(void);
55  int SetDescription(const char * desc);
56  void GetDescription(void);
57 
58  void CreateWithInitialValueFromCSV(Timestamp * Time,const char * Filename,enum BODataType DataType,char Delimiter);
59  void CreateWithInitialValueFromCSV(const char * Filename,enum BODataType DataType);
60  void CreateWithInitialValueFromCSV(const char * Filename,enum BODataType DataType,char Delimiter);
61  void CreateWithValuesFromCSV(const char * Filename,enum BODataType DataType);
62  void CreateWithValuesFromCSV(const char * Filename,enum BODataType DataType,char Delimiter);
63 
64  void ExportAllValuesToCSV(const char * Filename);
65 
66  void ExportRaw(const char * Filename);
67  void ImportRaw(const char * Filename);
68  void ImportRaw(const char * Filename,float A,float B);
69 
70 //Accessors
71 
72  void SetByte(SADBu8 Value,...);
73  void SetInteger(SADBu32 Value,...);
74  void SetFloat(SADBfl Value,...);
75  void SetDouble(SADBdfl Value,...);
76  void SetString(const char * str);
77  void SetStringElement(const char * str,...);
78  void SetBoolean(bool Value,...);
79 
80  SADBu8 GetByte(int X,...);
81  SADBu32 GetInteger(int X,...);
82  SADBfl GetFloat(int X,...);
83  SADBdfl GetDouble(int X,...);
84  const char * GetString(void);
85  char * GetNewString(void);
86  bool GetBoolean(int X,...);
87  char * GetStringElement(int X,...);
88 
89 
90 
91 
92 
93 
94 
95  void RemoveOldestValue(void);
96  void KeepOnlyLatestValues(int nValues);
97 
98 
99  int CheckForNewValue(void);
100 
101 
102  void Information(void);
103  void SetTimestamp(Timestamp * time);
104  void SetTimestampNow(void);
105 
108 
110  SADBu8 * Name;
112  SADBu8 * Description;
114  void * Data;
116  SADBu32 Dimensionality;
118  SADBu32 * Dimensions;
122  enum BODataType DataType;
126  SADBu64 ID;
129 
130 
131  private:
132  Pointer GetElementLocation(int*Pos);
133 
134 };
135 #endif
136 
SADBu8 * Description
Human Readable Object Description.
Definition: BlackboardObject.h:112
SADBu64 ID
Object ID on the blackboard.
Definition: BlackboardObject.h:126
SADBu32 Dimensionality
Dimensionality of the data (number of dimensiosns)
Definition: BlackboardObject.h:116
int ElementSize
Element Size (in bytes)
Definition: BlackboardObject.h:124
SADBu8 * Name
Human Readable Object Name.
Definition: BlackboardObject.h:110
Definition: BlackboardObject.h:6
int TotalNumberOfElements
Total number of elements (Product of all dimensions)
Definition: BlackboardObject.h:120
Definition: Blackboard.h:8
SADBu32 * Dimensions
Dimensions of the data.
Definition: BlackboardObject.h:118
void * Data
Pointer to Memory Location of the data.
Definition: BlackboardObject.h:114
Blackboard * Board
Blackboard where the object resides.
Definition: BlackboardObject.h:107
Timestamp Time
Timestamp of the data.
Definition: BlackboardObject.h:128
enum BODataType DataType
Data Type.
Definition: BlackboardObject.h:122
Definition: Timestamp.h:4