Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / tests / File_IO / File_i.h
blob44c7bedce18cd7ca2c70a2d3a08e517cbfee493e
2 //=============================================================================
3 /**
4 * @file File_i.h
6 * Defines the implementation classes for the File IDL
7 * module
9 * @author Irfan Pyarali
11 //=============================================================================
14 #include "FileS.h"
16 /**
17 * @class FileImpl
19 * @brief FileImpl class provides the namespace for the File IDL module .
21 class FileImpl
23 public:
24 /**
25 * @class Descriptor
27 * @brief Descriptor implements the Descriptor interface in the File
28 * Module A single Descriptor servant can serve multiple object
29 * references
31 class Descriptor : public POA_File::Descriptor
33 public:
34 /// Constructor
35 Descriptor (PortableServer::POA_ptr poa);
37 /// Destructor
38 ~Descriptor (void);
40 /// Returns the default POA of this object
41 PortableServer::POA_ptr _default_POA (void);
43 /// write buffer to File corresponding to this Descriptor
44 virtual CORBA::Long write (const File::Descriptor::DataBuffer &buffer);
46 virtual File::Descriptor::DataBuffer *read (CORBA::Long num_bytes);
48 /// seek to the offset in file from whence
49 virtual CORBA::ULong lseek (CORBA::ULong offset,
50 CORBA::Long whence);
52 /// closes the file corresponding to the requested ObjectID
53 virtual void destroy (void);
55 private:
57 /// Extracts the ACE_HANDLE from the objectID
58 ACE_HANDLE fd (void);
60 PortableServer::POA_var poa_;
63 /**
64 * @class System
66 * @brief File System implementation class.
68 class System : public POA_File::System
70 public:
71 /// Constructor, Creates a single File Descriptor Servant and
72 /// registers it with the POA as the Default Servant
73 System (PortableServer::POA_ptr poa);
75 ///Destructor
76 ~System (void);
78 ///Returns the default POA of this object
79 PortableServer::POA_ptr _default_POA (void);
81 /// Opens a file ,creates a Descriptor reference with the
82 /// ACE_HANDLE and returns that reference
83 File::Descriptor_ptr open (const char *file_name,
84 CORBA::Long flags);
86 private:
87 PortableServer::POA_var poa_;
89 /// The single File Descriptor servant which serves requests for
90 /// any Descriptor object under poa_.
91 Descriptor fd_servant_;