00001 #ifndef Impala_Persistency_ImageArchiveLocator_h
00002 #define Impala_Persistency_ImageArchiveLocator_h
00003
00004 #include "Basis/Quid.h"
00005 #include "Persistency/Locator.h"
00006
00007 namespace Impala
00008 {
00009 namespace Persistency
00010 {
00011
00012
00013 class ImageArchiveLocator : public Locator
00014 {
00015 public:
00016
00017 ImageArchiveLocator(const Locator& base, CString name)
00018 : Locator(base.GetProtocol(), base.GetHost(), base.GetDataSet())
00019 {
00020 mUseOnlyName = true;
00021 mName = name;
00022 mIsFset = false;
00023 }
00024
00025 ImageArchiveLocator(CString protocolAndHost, CString dataSet, CString name)
00026 : Locator(protocolAndHost, dataSet)
00027 {
00028 mUseOnlyName = true;
00029 mName = name;
00030 mIsFset = false;
00031 }
00032
00038 ImageArchiveLocator(CString protocolAndHost, CString dataSet,
00039 bool frames, CString container, CString name, Quid quid)
00040 : Locator(protocolAndHost, dataSet)
00041 {
00042 mUseOnlyName = false;
00043 mFrames = frames;
00044 mContainer = container;
00045 mName = name;
00046 mQuid = quid;
00047 mIsFset = false;
00048 }
00049
00050 ImageArchiveLocator(const Locator& base,
00051 bool frames, CString container, CString name, Quid quid)
00052 : Locator(base.GetProtocol(), base.GetHost(), base.GetDataSet())
00053 {
00054 mUseOnlyName = false;
00055 mFrames = frames;
00056 mContainer = container;
00057 mName = name;
00058 mQuid = quid;
00059 mIsFset = false;
00060 }
00061
00062 virtual
00063 ~ImageArchiveLocator()
00064 {
00065 }
00066
00067 bool
00068 GetUseOnlyName() const
00069 {
00070 return mUseOnlyName;
00071 }
00072
00073 bool
00074 GetFrames() const
00075 {
00076 return mFrames;
00077 }
00078
00079 String
00080 GetFramesString() const
00081 {
00082 if (mUseOnlyName)
00083 return "";
00084 return (mFrames) ? "Frames" : "ImageArchive";
00085 }
00086
00087 String
00088 GetContainer() const
00089 {
00090 if (mUseOnlyName)
00091 return "";
00092 return mContainer;
00093 }
00094
00095 void
00096 SetContainer(CString container)
00097 {
00098 mContainer = container;
00099 }
00100
00101 String
00102 GetName() const
00103 {
00104 return mName;
00105 }
00106
00107 Quid
00108 GetQuid() const
00109 {
00110 return mQuid;
00111 }
00112
00113 void
00114 SetQuid(Quid quid)
00115 {
00116 mQuid = quid;
00117 }
00118
00119 void
00120 SetIsFset(bool flag)
00121 {
00122 mIsFset = flag;
00123 }
00124
00125 bool
00126 GetIsFset() const
00127 {
00128 return mIsFset;
00129 }
00130
00131 String
00132 ToString() const
00133 {
00134 return "ImageArchiveLocator(" + GetProtocol() + "," + GetHost()
00135 + "," + GetDataSet() + "," + GetFramesString() + "," + GetContainer()
00136 + "," + GetName() + ")";
00137 }
00138
00139 private:
00140
00141 bool mUseOnlyName;
00142 bool mFrames;
00143 String mContainer;
00144 String mName;
00145 Quid mQuid;
00146 bool mIsFset;
00147
00148 ILOG_VAR_DEC;
00149 };
00150
00151 ILOG_VAR_INIT(ImageArchiveLocator, Impala.Persistency);
00152
00153 std::ostream&
00154 operator<< (std::ostream& os, const ImageArchiveLocator& loc)
00155 {
00156 os << loc.ToString();
00157 return os;
00158 }
00159
00160 }
00161 }
00162
00163 #endif