3 //=============================================================================
7 * This class implements the Grid IDL interface.
9 //=============================================================================
16 #include "ace/Memory_Pool.h"
17 #include "ace/Null_Mutex.h"
18 #include "ace/Malloc_T.h"
20 typedef ACE_Malloc
<ACE_MMAP_MEMORY_POOL
, ACE_Null_Mutex
> pool_t
;
21 // Memory pool for the persistent stuff
23 //class Grid_Factory_i;
25 * @class Grid_Factory_i
29 class Grid_Factory_i
: public POA_Grid_Factory
33 Grid_Factory_i (void);
36 ~Grid_Factory_i (void);
38 /// This function creates and returns a <Grid>.
39 virtual Grid_ptr
make_grid (CORBA::Short
,
42 /// Shutdown the server.
43 virtual void shutdown (void);
45 /// Do a clean up of the memory map
46 virtual void cleanup ( );
48 /// Set the ORB pointer.
49 void orb (CORBA::ORB_ptr o
);
51 /// Set the pool pointer
52 void pool_name (const ACE_TCHAR
*name
);
59 ACE_TCHAR
*pool_name_
;
61 /// Hold the pool of name pool_name_
64 void operator= (const Grid_Factory_i
&);
71 * @brief Grid object implementation.
73 * Grid object implementation
75 class Grid_i
: public POA_Grid
82 Grid_i (CORBA::Short
, CORBA::Short
, pool_t
*);
87 /// Returns the width of the grid
88 virtual CORBA::Short
width (void);
90 /// Returns the height of the grid
91 virtual CORBA::Short
height (void);
93 /// Sets the width of the grid.
94 virtual void width (CORBA::Short
);
96 /// Sets the height of the grid.
97 virtual void height (CORBA::Short
);
99 /// Sets the grid value.
100 virtual void set (CORBA::Short
,
104 /// Gets the grid value.
105 virtual CORBA::Long
get (CORBA::Short
,
108 /// Destroy the grid.
109 virtual void destroy (void);
111 /// Set a pointer to the pool
112 void set_pool (pool_t
*);
115 /// Width of the grid.
118 /// Height of the grid.
119 CORBA::Short height_
;
121 /// Pointer to the matrix. This is organized as an "array of arrays."
122 CORBA::Long
**array_
;
124 ///Pointer to the memory pool..
129 #endif /* GRID_I_H */