Last change
on this file since 4396 was 4396, checked in by Eric.Larour, 15 years ago |
Made Hooks in object a pointer. Makes for an easier Hook interface
|
File size:
1.6 KB
|
Rev | Line | |
---|
[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*/
|
---|
[3681] | 13 | #include "./Object.h"
|
---|
[3420] | 14 | class DataSet;
|
---|
[3637] | 15 | /*}}}*/
|
---|
[3383] | 16 |
|
---|
| 17 | class Hook{
|
---|
| 18 |
|
---|
| 19 | private:
|
---|
| 20 |
|
---|
| 21 | int num; //number of objects being hooked onto
|
---|
| 22 | 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.
|
---|
| 23 | int* ids; //list of object ids, to go look for them in datasets.
|
---|
| 24 | int* offsets; //list of object offsets into datasets, to speed up lookup.
|
---|
| 25 |
|
---|
| 26 | public:
|
---|
| 27 |
|
---|
[4248] | 28 | /*Hook constructors, destructors: {{{*/
|
---|
[3383] | 29 | Hook();
|
---|
| 30 | Hook(int* ids, int num);
|
---|
| 31 | ~Hook();
|
---|
[4248] | 32 | /*}}}*/
|
---|
| 33 | /*Object like functionality:{{{1*/
|
---|
| 34 | void Echo(void);
|
---|
| 35 | void DeepEcho(void);
|
---|
[3383] | 36 | void Marshall(char** pmarshalled_dataset);
|
---|
| 37 | int MarshallSize();
|
---|
| 38 | void Demarshall(char** pmarshalled_dataset);
|
---|
[4396] | 39 | Object* copy(void);
|
---|
[4248] | 40 | /*}}}*/
|
---|
| 41 | /*Hook management: {{{1*/
|
---|
[3383] | 42 | Object* delivers(void); //single object deliver
|
---|
| 43 | Object** deliverp(void); //deliver all objects
|
---|
| 44 | void configure(DataSet* dataset);
|
---|
[4396] | 45 | Hook* Spawn(int* indices, int numindices);
|
---|
[3383] | 46 | Object** GetObjects(void);
|
---|
[3673] | 47 | int* Ids(void);
|
---|
[3383] | 48 | int* GetOffsets(void);
|
---|
| 49 | int GetNum(void);
|
---|
[4248] | 50 | /*}}}*/
|
---|
[3383] | 51 | };
|
---|
| 52 |
|
---|
| 53 | #endif /* _HOOK_H_ */
|
---|
Note:
See
TracBrowser
for help on using the repository browser.