Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

FileLocator.h

Go to the documentation of this file.
00001 #ifndef Impala_Persistency_FileLocator_h
00002 #define Impala_Persistency_FileLocator_h
00003 
00004 #include "Persistency/Locator.h"
00005 
00006 namespace Impala
00007 {
00008 namespace Persistency
00009 {
00010 
00011 
00015 class FileLocator : public Locator
00016 {
00017 public:
00018 
00019     FileLocator(CString name)
00020         : Locator("file:", "direct")
00021     {
00022         mName = name;
00023     }
00024 
00025     FileLocator(CString protocolAndHost, CString dataSet, CString name)
00026         : Locator(protocolAndHost, dataSet)
00027     {
00028         mName = name;
00029     }
00030 
00031     FileLocator(CString name, CmdOptions& options)
00032         : Locator("dot", options)
00033     {
00034         mName = name;
00035     }
00036 
00037     FileLocator(const Locator& base, CString name)
00038         : Locator(base.GetProtocol(), base.GetHost(), base.GetDataSet())
00039     {
00040         mName = name;
00041     }
00042 
00043     virtual
00044     ~FileLocator()
00045     {
00046     }
00047 
00048     String
00049     GetName() const
00050     {
00051         return mName;
00052     }
00053 
00054     String
00055     GetDir() const
00056     {
00057         return FileNamePath2(mName);
00058     }
00059 
00060     String
00061     ToString() const
00062     {
00063         return "FileLocator(" + GetProtocol() + "," + GetHost()
00064             + "," + GetDataSet() + "," + GetName() + ")";
00065     }
00066 
00067 private:
00068 
00069     String mName;
00070 
00071     ILOG_VAR_DEC;
00072 };
00073 
00074 ILOG_VAR_INIT(FileLocator, Impala.Persistency);
00075 
00076 std::ostream&
00077 operator<< (std::ostream& os, const FileLocator& loc)
00078 {
00079     os << loc.ToString();
00080     return os;
00081 }
00082 
00083 } // namespace Persistency
00084 } // namespace Impala
00085 
00086 #endif

Generated on Thu Jan 13 09:05:03 2011 for ImpalaSrc by  doxygen 1.5.1