#include <RioInterface.h>
Public Member Functions | |
CRioDirectory () | |
~CRioDirectory () | |
RioResult | FirstObject (char *DirectoryName, const int BufferSize, char *ObjectName, int *IsDirectory, CRioSession *RioSession) |
RioResult | NextObject (const int BufferSize, char *ObjectName, int *IsDirectory) |
RioResult | Close () |
Private Member Functions | |
void | FreeMembers () |
Private Attributes | |
CObjectManager * | m_ObjectManager |
CRioTCP * | m_TCPconnection |
ObjectHandle | m_ObjectHandle |
bool | m_opened |
Definition at line 619 of file RioInterface.h.
CRioDirectory::CRioDirectory | ( | ) |
Definition at line 34 of file RioDirectory.cpp.
00035 { 00036 m_ObjectManager = 0; 00037 m_TCPconnection = 0; 00038 m_ObjectHandle.Version = -1; 00039 m_ObjectHandle.Index = -1; 00040 m_opened = false; 00041 }
CRioDirectory::~CRioDirectory | ( | ) |
Definition at line 43 of file RioDirectory.cpp.
RioResult CRioDirectory::Close | ( | void | ) |
Definition at line 105 of file RioDirectory.cpp.
00106 { 00107 00108 // Check if object is opened 00109 if(!m_opened) 00110 { 00111 return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED; 00112 } 00113 00114 // Free memory for class member variables 00115 FreeMembers(); 00116 00117 m_opened = false; 00118 00119 return S_OK; 00120 }
RioResult CRioDirectory::FirstObject | ( | char * | DirectoryName, | |
const int | BufferSize, | |||
char * | ObjectName, | |||
int * | IsDirectory, | |||
CRioSession * | RioSession | |||
) |
Definition at line 51 of file RioDirectory.cpp.
00056 { 00057 // IStreamManager *StreamManager; 00058 RioSessionId SessionId; 00059 00060 // Check if directory is not already opened 00061 if(m_opened) 00062 { 00063 return ERROR_RIOOBJECT + ERROR_OBJECT_ALREADY_OPENED; 00064 } 00065 00066 HRESULT hResult; 00067 hResult = RioSession->GetId(&SessionId); 00068 if(FAILED(hResult)) 00069 { 00070 // m_log << "Open(): Failed to get Stream Id." << endl 00071 // << "Error:" << hResult << endl; 00072 return hResult; 00073 } 00074 00075 // Get TCPconnection from RioStream 00076 m_TCPconnection = RioSession->m_TCPconnection; 00077 00078 // Create Object Manager Proxy 00079 m_ObjectManager = new CObjectManager(m_TCPconnection); 00080 00081 // Create Temporary Stream Manager Proxy 00082 CSessionManager SessionManager(m_TCPconnection); 00083 00084 hResult = SessionManager.FirstObject(SessionId, 00085 (signed char*)DirectoryName, 00086 &m_ObjectHandle, 00087 IsDirectory, 00088 BufferSize, 00089 (signed char*)ObjectName); 00090 if(FAILED(hResult)) 00091 { 00092 m_ObjectHandle.Version = -1; 00093 m_ObjectHandle.Index = -1; 00094 FreeMembers(); 00095 return hResult; 00096 } 00097 00098 00099 m_opened = true; 00100 00101 return S_OK; 00102 }
void CRioDirectory::FreeMembers | ( | ) | [private] |
Definition at line 147 of file RioDirectory.cpp.
00148 { 00149 if(m_ObjectHandle.Index != -1) 00150 { 00151 m_ObjectManager->Close(m_ObjectHandle); 00152 m_ObjectHandle.Version = -1; 00153 m_ObjectHandle.Index = -1; 00154 } 00155 00156 if(m_TCPconnection !=0) 00157 { 00158 m_TCPconnection = 0; 00159 } 00160 00161 if(m_ObjectManager != 0) 00162 { 00163 delete m_ObjectManager; 00164 m_ObjectManager = 0; 00165 } 00166 00167 }
RioResult CRioDirectory::NextObject | ( | const int | BufferSize, | |
char * | ObjectName, | |||
int * | IsDirectory | |||
) |
Definition at line 123 of file RioDirectory.cpp.
00126 { 00127 // Check if object is opened 00128 if(!m_opened) 00129 { 00130 return ERROR_RIOOBJECT + ERROR_OBJECT_NOT_OPENED; 00131 } 00132 00133 HRESULT hResult; 00134 00135 // Change object size 00136 hResult = m_ObjectManager->NextObject(m_ObjectHandle, 00137 IsDirectory, 00138 BufferSize, 00139 (signed char*) ObjectName); 00140 00141 00142 return hResult; 00143 00144 }
ObjectHandle CRioDirectory::m_ObjectHandle [private] |
Definition at line 637 of file RioInterface.h.
CObjectManager* CRioDirectory::m_ObjectManager [private] |
Definition at line 635 of file RioInterface.h.
bool CRioDirectory::m_opened [private] |
Definition at line 638 of file RioInterface.h.
CRioTCP* CRioDirectory::m_TCPconnection [private] |
Definition at line 636 of file RioInterface.h.