2 //=============================================================================
6 * Defines the implementation classes for the File IDL
9 * @author Irfan Pyarali
11 //=============================================================================
19 * @brief FileImpl class provides the namespace for the File IDL module .
27 * @brief Descriptor implements the Descriptor interface in the File
28 * Module A single Descriptor servant can serve multiple object
31 class Descriptor
: public POA_File::Descriptor
35 Descriptor (PortableServer::POA_ptr poa
);
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
,
52 /// closes the file corresponding to the requested ObjectID
53 virtual void destroy (void);
57 /// Extracts the ACE_HANDLE from the objectID
60 PortableServer::POA_var poa_
;
66 * @brief File System implementation class.
68 class System
: public POA_File::System
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
);
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
,
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_
;