Cleanup Solaris support
[ACE_TAO.git] / TAO / examples / Simple / grid / Grid_i.h
blobfcce738f501fd0cf142d2b21250bbaae33c5ef22
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Grid_i.h
7 * This class implements the Grid IDL interface.
8 */
9 //=============================================================================
12 #ifndef GRID_I_H
13 #define GRID_I_H
15 #include "GridS.h"
16 #include "ace/Vector_T.h"
17 #include "ace/Auto_Ptr.h"
19 /**
20 * @class Grid_i:
22 * @brief Grid object implementation.
24 * Grid object implementation
26 class Grid_i: public POA_Grid
28 public:
29 /// Constructor
30 Grid_i ();
32 /// Constructor.
33 Grid_i (CORBA::Short,
34 CORBA::Short);
36 /// Destructor
37 virtual ~Grid_i ();
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,
53 CORBA::Short,
54 CORBA::Long);
56 /// Gets the grid value.
57 virtual CORBA::Long get (CORBA::Short,
58 CORBA::Short);
60 /// Destroy the grid.
61 virtual void destroy ();
63 private:
64 /// Allocates array
65 static CORBA::Long *allocate_array (CORBA::Short x, CORBA::Short y);
67 /// Width of the grid.
68 CORBA::Short width_;
70 /// Height of the grid.
71 CORBA::Short height_;
73 /// Pointer to the matrix. This is organized as an "array of arrays."
74 typedef ACE_Auto_Array_Ptr<CORBA::Long> GridArray;
75 GridArray array_;
77 /// Some Windows compilers don't have min in std namespaces
78 static CORBA::UShort ushort_min (CORBA::UShort, CORBA::UShort);
81 /**
82 * @class Grid_Factory_i
84 * Create a <Grid>.
86 class Grid_Factory_i : public POA_Grid_Factory
88 public:
89 /// Constructor.
90 Grid_Factory_i ();
92 /// Destructor.
93 virtual ~Grid_Factory_i ();
95 /// This function creates and returns a <Grid>.
96 virtual Grid_ptr make_grid (CORBA::Short,
97 CORBA::Short);
99 /// Shutdown the server.
100 virtual void shutdown ();
102 /// Set the ORB pointer.
103 void orb (CORBA::ORB_ptr o);
105 private:
106 /// This container is here only for proper clean up.
107 typedef ACE_Vector<PortableServer::ServantBase_var> GridsHolder;
108 GridsHolder grids_holder_;
110 /// ORB pointer.
111 CORBA::ORB_var orb_;
113 void operator= (const Grid_Factory_i &);
116 #endif /* GRID_I_H */