3 //=============================================================================
7 * This class implements the Grid IDL interface.
9 //=============================================================================
16 #include "ace/Vector_T.h"
17 #include "ace/Auto_Ptr.h"
22 * @brief Grid object implementation.
24 * Grid object implementation
26 class Grid_i
: public POA_Grid
39 /// Returns the width of the grid
40 virtual CORBA::Short
width ();
42 /// Returns the height of the grid
43 virtual CORBA::Short
height ();
45 /// Sets the width of the grid.
46 virtual void width (CORBA::Short
);
48 /// Sets the height of the grid.
49 virtual void height (CORBA::Short
);
51 /// Sets the grid value.
52 virtual void set (CORBA::Short
,
56 /// Gets the grid value.
57 virtual CORBA::Long
get (CORBA::Short
,
61 virtual void destroy ();
65 static CORBA::Long
*allocate_array (CORBA::Short x
, CORBA::Short y
);
67 /// Width of the grid.
70 /// Height of the grid.
73 /// Pointer to the matrix. This is organized as an "array of arrays."
74 typedef ACE_Auto_Array_Ptr
<CORBA::Long
> GridArray
;
77 /// Some Windows compilers don't have min in std namespaces
78 static CORBA::UShort
ushort_min (CORBA::UShort
, CORBA::UShort
);
82 * @class Grid_Factory_i
86 class Grid_Factory_i
: public POA_Grid_Factory
93 virtual ~Grid_Factory_i ();
95 /// This function creates and returns a <Grid>.
96 virtual Grid_ptr
make_grid (CORBA::Short
,
99 /// Shutdown the server.
100 virtual void shutdown ();
102 /// Set the ORB pointer.
103 void orb (CORBA::ORB_ptr o
);
106 /// This container is here only for proper clean up.
107 typedef ACE_Vector
<PortableServer::ServantBase_var
> GridsHolder
;
108 GridsHolder grids_holder_
;
113 void operator= (const Grid_Factory_i
&);
116 #endif /* GRID_I_H */