Per Namespace Reference

Enumerations

enum  EAccessMode { kRead, kNew, kRecreate, kUpdate }
enum  EStreamType {
  kDaqSnarl, kDaqMonitor, kLightInjection, kDcsAlarm,
  kDcsMonitor, kBeamMon, kCand, kConfig
}
enum  EErrorCode {
  kErrSuccess, kErrFileExists, kErrFileNotFound, kErrFileNoSpace,
  kErrFileConflict, kErrFileError, kErrTreeExists, kErrTreeReadError,
  kErrInvalidAccessMode
}
enum  ESequenceMode {
  kSequential, kKey, kLowerBound, kRandom,
  kWindow
}

Functions

const char * AsString (EStreamType streamtype)
const char * AsString (EAccessMode accessmode)
const char * AsString (EErrorCode errorcode)
const char * AsString (ESequenceMode sequencemode)
const char * GetAssociatedStreamList (const char *streamname)
int GetAccessMode (const char *accessmode)
int GetSequenceMode (const char *sequencemode)
int GetStreamType (const char *streamtype)
Per::ESequenceMode GetDefSequenceMode (const char *streamname)
const VldContextGetVldBegin ()
const VldContextGetVldEnd ()
bool IsBegin (const VldContext &vldc)
bool IsEnd (const VldContext &vldc)

Variables

static const Int_t kRecSplit = 99

Enumeration Type Documentation

Enumerator:
kRead 
kNew 
kRecreate 
kUpdate 

Definition at line 20 of file Per.h.

00020                    {
00021     // File access modes.  These are translated into access mode strings by
00022     // Per::AsString.
00023     kRead,     // Open existing file in read mode.
00024     kNew,      // Open new file in read/write, don't overwrite existing file
00025                // of same name.
00026     kRecreate, // Open new file in read/write, overwrite existing file of same 
00027                // name.
00028     kUpdate    // Open existing file in read/write, or open new file if no 
00029                // existing file of requested name. 
00030   };

Enumerator:
kErrSuccess 
kErrFileExists 
kErrFileNotFound 
kErrFileNoSpace 
kErrFileConflict 
kErrFileError 
kErrTreeExists 
kErrTreeReadError 
kErrInvalidAccessMode 

Definition at line 48 of file Per.h.

00048                   {
00049     // ErrorCodes used by Persistency classes to record file or stream
00050     // open errors.  Translated into strings by Per::AsString.
00051     kErrSuccess,     // File or stream open was successful
00052     kErrFileExists,  // Failed to open new file because it already exists 
00053     kErrFileNotFound,// Failed to open requested file - does not exist
00054     kErrFileNoSpace, // File open failed due to lack of space on device
00055     kErrFileConflict,// File open refused by filemanager due to incompatible
00056                      // access mode with existing client
00057     kErrFileError,   // Generic file open failure
00058     kErrTreeExists,  // Failed to open new tree because it already exists
00059     kErrTreeReadError, // Failed to find tree or error in tree structure
00060     kErrInvalidAccessMode // Failed to open a file for the requested stream 
00061     // because requested accessmode is incompatible with stream type
00062   };

Enumerator:
kSequential 
kKey 
kLowerBound 
kRandom 
kWindow 

Definition at line 64 of file Per.h.

00064                      {
00065     // Stream input sequence mode.  These are translated into sequence mode 
00066     // strings by Per::AsString.
00067     kSequential, // Streams are sequenced by input order regardless of
00068                  // Key or validity context
00069     kKey, // At least one Key input stream per job. Records from other
00070           // types of streams are sequenced according to the Key stream(s).    
00071     kLowerBound, // A record of a validity <= to a Key stream validity is
00072                  // loaded from a kLowerBound stream for every record set.
00073     kRandom, // Streams are returned at random regardless of Key or validity context
00074     kWindow // Records with validity w/in this window of the Key
00075             // stream validity are loaded from a kWindow stream for
00076             // every record set.
00077   };

Enumerator:
kDaqSnarl 
kDaqMonitor 
kLightInjection 
kDcsAlarm 
kDcsMonitor 
kBeamMon 
kCand 
kConfig 

Definition at line 32 of file Per.h.

00032                    {
00033     // Supported framework data streams.  These are translated into stream
00034     // strings by Per::AsString.  Note that this list of streams is
00035     // provided as a convenience to users of standard framework streams,
00036     // but users can also define and implement their own streams outside of 
00037     // this list.
00038     kDaqSnarl,
00039     kDaqMonitor,
00040     kLightInjection,
00041     kDcsAlarm,
00042     kDcsMonitor,
00043     kBeamMon,
00044     kCand,
00045     kConfig
00046   };


Function Documentation

const char * Per::AsString ( ESequenceMode  sequencemode  ) 

Definition at line 138 of file Per.cxx.

References kKey, kLowerBound, kRandom, kSequential, Msg::kWarning, kWindow, and MSG.

00138                                                     {
00139   //  Purpose:  Convert enumerated sequencemode to a sequencemode string.
00140   //
00141   //  Argument: sequencemode: enumerated ESequenceMode described in Per.h.
00142   //
00143   //  Return:  sequencemode string. If unknown, returns "Unknown".
00144   //
00145   //  Contact:   S. Kasahara
00146   //
00147 
00148   switch ( sequencemode ) {
00149   case kKey:
00150     return "Key";
00151   case kLowerBound:
00152     return "LowerBound";
00153   case kWindow:
00154     return "Window";
00155   case kSequential:
00156     return "Sequential";
00157   case kRandom:
00158     return "Random";
00159   default:
00160     MSG("Per",Msg::kWarning) 
00161       << "Per::AsString called with unknown sequencemode" 
00162       << (int)sequencemode << endl;
00163     return "Unknown";
00164   }//end of switch
00165 
00166 }

const char * Per::AsString ( EErrorCode  errorcode  ) 

Definition at line 64 of file Per.cxx.

References kErrFileConflict, kErrFileError, kErrFileExists, kErrFileNoSpace, kErrFileNotFound, kErrInvalidAccessMode, kErrSuccess, kErrTreeExists, kErrTreeReadError, Msg::kWarning, and MSG.

00064                                               {
00065   //  Purpose:  Convert enumerated error code to an error string.
00066   //
00067   //  Argument: errorcode   enumerated EErrorCode described in Per.h.
00068   //
00069   //  Return:  error string. If error is unknown, returns "Unknown".
00070   //
00071   //  Contact:   S. Kasahara
00072   //
00073 
00074   switch ( errorcode ) {
00075     case kErrSuccess:
00076       return "Success";
00077     case kErrFileExists:
00078       return "FileExists";
00079     case kErrFileNotFound:
00080       return "FileNotFound";
00081     case kErrFileNoSpace:
00082       return "FileNoSpace";
00083     case kErrFileConflict:
00084       return "FileConflict";
00085     case kErrFileError:
00086       return "FileError";
00087     case kErrTreeExists:
00088       return "TreeExists";
00089     case kErrTreeReadError:
00090       return "TreeReadError"; 
00091     case kErrInvalidAccessMode:
00092       return "InvalidAccessMode";
00093     default:
00094       MSG("Per",Msg::kWarning) 
00095       << "Per::AsString called with unknown error code" 
00096       << (int)errorcode << endl;
00097       return "Unknown";
00098   }//end of switch
00099 
00100 }

const char * Per::AsString ( EAccessMode  accessmode  ) 

Definition at line 36 of file Per.cxx.

References kNew, kRead, kRecreate, kUpdate, Msg::kWarning, and MSG.

00036                                                 {
00037   //  Purpose:  Convert enumerated accessmode to an access string.
00038   //
00039   //  Argument: accessmode: enumerated EAccessMode described in Per.h.
00040   //
00041   //  Return:  access string. If accessmode is unknown, returns "UNKNOWN".
00042   //
00043   //  Contact:   S. Kasahara
00044   //
00045 
00046   switch ( accessmode ) {
00047     case kRead:
00048       return "READ";
00049     case kNew:
00050       return "NEW";
00051     case kRecreate:
00052       return "RECREATE";
00053     case kUpdate:
00054       return "UPDATE";
00055     default:
00056       MSG("Per",Msg::kWarning) 
00057       << "Per::AsString called with unknown accessmode" 
00058       << (int)accessmode << endl;
00059       return "UNKNOWN";
00060   }//end of switch
00061 
00062 }

const char * Per::AsString ( EStreamType  streamtype  ) 

Definition at line 102 of file Per.cxx.

References kBeamMon, kCand, kConfig, kDaqMonitor, kDaqSnarl, kDcsAlarm, kDcsMonitor, kLightInjection, Msg::kWarning, and MSG.

Referenced by DDSSubscription::AddStream(), RotoServer::OpenFile(), and DDSSubscription::RemoveStream().

00102                                                 {
00103   //  Purpose:  Convert enumerated stream type to a stream string.
00104   //
00105   //  Argument: streamtype   enumerated EStreamType described in Per.h.
00106   //
00107   //  Return:  stream string. If stream is unknown, returns "Unknown".
00108   //
00109   //  Contact:   S. Kasahara
00110   //
00111 
00112   switch ( streamtype ) {
00113     case kDaqSnarl:
00114       return "DaqSnarl";
00115     case kDaqMonitor:
00116       return "DaqMonitor";
00117     case kLightInjection:
00118       return "LightInjection";
00119     case kDcsAlarm:
00120       return "DcsAlarm";
00121     case kDcsMonitor:
00122       return "DcsMonitor";
00123     case kBeamMon:
00124       return "BeamMon";
00125     case kCand:
00126       return "Cand";
00127     case kConfig:
00128       return "Config";
00129     default:
00130       MSG("Per",Msg::kWarning) 
00131       << "Per::AsString called with unknown stream type" 
00132       << (int)streamtype << endl;
00133       return "Unknown";
00134   }//end of switch
00135 
00136 }

int Per::GetAccessMode ( const char *  accessmode  ) 

Definition at line 168 of file Per.cxx.

References kNew, kRead, kRecreate, and kUpdate.

Referenced by IoOutputModule::Config().

00168                                              {
00169   // Purpose: Convert text string accessmode to an enumerated code.
00170   // 
00171   // Argument: accessmode string
00172   //
00173   // Return: returns -1 if no match
00174   //
00175   // Contact: S. Kasahara
00176   //
00177 
00178   TString tmpstr(accessmode);
00179   tmpstr.ToLower();
00180   if ( strcmp(tmpstr.Data(),"read") == 0 ) return Per::kRead;
00181   else if ( strcmp(tmpstr.Data(),"new") == 0 ) return Per::kNew;
00182   else if ( strcmp(tmpstr.Data(),"recreate") == 0 ) return Per::kRecreate;
00183   else if ( strcmp(tmpstr.Data(),"update") == 0 ) return Per::kUpdate;
00184 
00185   return -1;
00186 
00187 }

const char * Per::GetAssociatedStreamList ( const char *  streamname  ) 

Definition at line 256 of file Per.cxx.

References GetStreamType(), and kCand.

Referenced by IoInputStreamItr::AddFile(), IoOutputModule::AttachAssociatedStreams(), and IoInputStreamItr::Streams().

00256                                                                {
00257   //  Purpose:  Return streams associated (coupled) with specified stream.
00258   //
00259   //  Argument: streamname (e.g. "DaqSnarl")
00260   //
00261   //  Return:  default associated streamlist for this stream.  If stream
00262   //           is unknown, default of "" is returned.
00263   //
00264   //  Contact:   S. Kasahara
00265   //
00266 
00267   int streamtype = Per::GetStreamType(streamname);
00268   switch ( streamtype ) {
00269     case kCand:
00270       return "Config";
00271     default:
00272       return "";
00273   } // end of switch
00274   
00275 }

Per::ESequenceMode Per::GetDefSequenceMode ( const char *  streamname  ) 

Definition at line 235 of file Per.cxx.

References GetStreamType(), kConfig, kKey, and kLowerBound.

Referenced by PerInputStreamManager::OpenStream().

00235                                                                {
00236   //  Purpose:  Return default sequencemode for specified stream.
00237   //
00238   //  Argument: streamname (e.g. "Cand")
00239   //
00240   //  Return:  default sequence mode for this stream.  If stream
00241   //           is unknown, default of Per::kKey is returned.
00242   //
00243   //  Contact:   S. Kasahara
00244   //
00245 
00246   int streamtype = Per::GetStreamType(streamname);
00247   switch ( streamtype ) {
00248     case kConfig:
00249       return Per::kLowerBound;
00250     default:
00251       return Per::kKey;
00252   } // end of switch
00253   
00254 }

int Per::GetSequenceMode ( const char *  sequencemode  ) 

Definition at line 189 of file Per.cxx.

References kKey, and kLowerBound.

Referenced by PerInputStreamManager::LoadRecord().

00189                                                  {
00190   // Purpose: Convert text string sequencemode to an enumerated code.
00191   // 
00192   // Argument: sequencemode string
00193   //
00194   // Return: returns -1 if no match
00195   //
00196   // Contact: S. Kasahara
00197   //
00198 
00199   TString tmpstr(sequencemode);
00200   tmpstr.ToLower();
00201   if ( strcmp(tmpstr.Data(),"key") == 0 ) return Per::kKey;
00202   else if ( strcmp(tmpstr.Data(),"lowerbound") == 0 ) return Per::kLowerBound;
00203 
00204   return -1;
00205 
00206 }

int Per::GetStreamType ( const char *  streamtype  ) 

Definition at line 208 of file Per.cxx.

References kBeamMon, kCand, kConfig, kDaqMonitor, kDaqSnarl, kDcsAlarm, kDcsMonitor, and kLightInjection.

Referenced by GetAssociatedStreamList(), and GetDefSequenceMode().

00208                                              {
00209   // Purpose: Convert text string streamname to an enumerated code.
00210   // 
00211   // Argument: streamname string
00212   //
00213   // Return: returns -1 if no match
00214   //
00215   // Contact: S. Kasahara
00216   //
00217 
00218   TString tmpstr(streamname);
00219   tmpstr.ToLower();
00220   if ( strcmp(tmpstr.Data(),"daqsnarl") == 0 ) return Per::kDaqSnarl;
00221   else if ( strcmp(tmpstr.Data(),"daqmonitor") == 0 ) return Per::kDaqMonitor;
00222   else if ( strcmp(tmpstr.Data(),"lightinjection") == 0 ) 
00223                                                 return Per::kLightInjection;
00224   else if ( strcmp(tmpstr.Data(),"dcsalarm") == 0 ) return Per::kDcsAlarm;
00225   else if ( strcmp(tmpstr.Data(),"dcsmonitor") == 0 ) return Per::kDcsMonitor;
00226   else if ( strcmp(tmpstr.Data(),"beammon") == 0 ) 
00227                                                 return Per::kBeamMon;
00228   else if ( strcmp(tmpstr.Data(),"cand") == 0 ) return Per::kCand;
00229   else if ( strcmp(tmpstr.Data(),"config") == 0 ) return Per::kConfig;
00230 
00231   return -1;
00232 
00233 }

const VldContext & Per::GetVldBegin (  ) 
const VldContext & Per::GetVldEnd (  ) 
bool Per::IsBegin ( const VldContext vldc  ) 

Definition at line 279 of file Per.cxx.

00279 { return (vldc == kVldBegin); }

bool Per::IsEnd ( const VldContext vldc  ) 

Definition at line 280 of file Per.cxx.

00280 { return (vldc == kVldEnd); }


Variable Documentation

const Int_t Per::kRecSplit = 99 [static]

Generated on 11 Jan 2018 for loon by  doxygen 1.6.1