StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StDataException.h
1 /*
2  * @file StDataException.h
3  * @author Stephen Tramer
4  *
5  * @(#)cpp/api:$Id: StDataException.h,v 1.2 2010/03/30 20:05:36 fine Exp $
6  *
7  * StDataException is the most generic exception class thrown by the base
8  * part of the data tier (and is so named because the base part of the library
9  * represents all data abstractions). It modifies provided descriptions
10  * to include additional information by prepending "[DATA:$type]", where
11  * $type indicates the type of data for where the exception occured.
12  */
13 
14 #ifndef _TX_DATA_EXCEPTION_H_
15 #define _TX_DATA_EXCEPTION_H_
16 
17 #include <string>
18 #include "StUCMException.h"
19 
25  public:
30  enum ObjectType {
31  STORE,
32  COLLECTION,
33  RECORD,
34  FIELD
35  };
36 
37  public:
44  StDataException( const std::string& description,
45  ObjectType object,
46  StUCMException::Severity severity = StUCMException::ERROR);
47 
51  virtual ~StDataException();
52 
53 
59  ObjectType getObjectType() const;
60 
61  private:
67  std::string typeToString() const;
68 
69  private:
70  ObjectType object_;
71 };
72 
73 #endif
StDataException(const std::string &description, ObjectType object, StUCMException::Severity severity=StUCMException::ERROR)
ObjectType getObjectType() const
virtual ~StDataException()