[3383] | 1 | /*!\file Hook.h
|
---|
| 2 | * \brief: header file for hook object.
|
---|
| 3 | * A hook is a class that can store the id, offset, and object corresponding to this id and offset into a dataset.
|
---|
| 4 | * For example, an element has a hook to its nodes. A node has a hook to its vertex. The hook abstracts the need for having
|
---|
| 5 | * ids and offsets (necesarry for proper configuration of an object) in our objects.
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef _HOOK_H_
|
---|
| 9 | #define _HOOK_H_
|
---|
| 10 |
|
---|
[3637] | 11 | /*Headers:*/
|
---|
| 12 | /*{{{1*/
|
---|
[3420] | 13 | class DataSet;
|
---|
| 14 | class Object;
|
---|
[3383] | 15 | #include "./Object.h"
|
---|
[3417] | 16 | #include "../DataSet/DataSet.h"
|
---|
[3383] | 17 | #include "../toolkits/toolkits.h"
|
---|
[3637] | 18 | /*}}}*/
|
---|
[3383] | 19 |
|
---|
| 20 | class Hook{
|
---|
| 21 |
|
---|
| 22 | private:
|
---|
| 23 |
|
---|
| 24 | int num; //number of objects being hooked onto
|
---|
| 25 | Object** objects; //list of object pointers. we do not allocate objects, just a list a pointers, that will get to point to the real objects from a dataset.
|
---|
| 26 | int* ids; //list of object ids, to go look for them in datasets.
|
---|
| 27 | int* offsets; //list of object offsets into datasets, to speed up lookup.
|
---|
| 28 |
|
---|
| 29 | public:
|
---|
| 30 |
|
---|
| 31 | Hook();
|
---|
| 32 | Hook(int* ids, int num);
|
---|
[3420] | 33 | void Init(int* ids, int num);
|
---|
[3383] | 34 | Hook(Object** objects, int* ids, int* offsets,int num);
|
---|
| 35 | Hook(Hook* hook);
|
---|
| 36 | ~Hook();
|
---|
| 37 | void Marshall(char** pmarshalled_dataset);
|
---|
| 38 | int MarshallSize();
|
---|
| 39 | void Demarshall(char** pmarshalled_dataset);
|
---|
| 40 | Object* delivers(void); //single object deliver
|
---|
| 41 | Object** deliverp(void); //deliver all objects
|
---|
| 42 | void configure(DataSet* dataset);
|
---|
| 43 | void Echo(void);
|
---|
| 44 | void DeepEcho(void);
|
---|
| 45 | Hook* Spawn(int* indices, int numindices);
|
---|
| 46 | Object** GetObjects(void);
|
---|
| 47 | int* GetIds(void);
|
---|
| 48 | int* GetOffsets(void);
|
---|
| 49 | int GetNum(void);
|
---|
| 50 |
|
---|
| 51 |
|
---|
| 52 | };
|
---|
| 53 |
|
---|
| 54 | #endif /* _HOOK_H_ */
|
---|