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 ();
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 ();
56 /// Extracts the ACE_HANDLE from the objectID
59 PortableServer::POA_var poa_
;
65 * @brief File System implementation class.
67 class System
: public POA_File::System
70 /// Constructor, Creates a single File Descriptor Servant and
71 /// registers it with the POA as the Default Servant
72 System (CORBA::ORB_ptr orb
,
73 PortableServer::POA_ptr poa
);
78 ///Returns the default POA of this object
79 PortableServer::POA_ptr
_default_POA ();
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
,
90 PortableServer::POA_var poa_
;
92 /// The single File Descriptor servant which serves requests for
93 /// any Descriptor object under poa_.
94 Descriptor fd_servant_
;