StreamBase C++ API  7.7.8.2
StreamBaseEntityType.hpp
1 // Copyright (c) 2004-2019 TIBCO Software Inc. All rights reserved.
2 
3 #ifndef STREAMBASE_ENTITY_TYPE_H
4 #define STREAMBASE_ENTITY_TYPE_H
5 
6 #include "StreamBase.hpp"
7 #include "Exceptions.hpp"
8 
9 #include <string>
10 
11 
12 SB_NAMESPACE_BEGIN;
13 
14 
15 /// A type of entity in a StreamBase catalog.
17 {
18  public:
19  /// An enumeration of the types of entities stored in a catalog.
20  enum Type {
21  /// A stream.
22  STREAM = 1,
23 
24  /// A schema.
25  SCHEMA = 2,
26 
27  /// An operator.
28  OPERATOR = 3,
29 
30  /// An window.
31  WINDOW_SPEC = 4,
32 
33  /// A container.
34  CONTAINER = 5,
35 
36  /// Pseudo-entity-type for tables
37  TABLE = 6,
38 
39  /// Pseudo-entity-type for input streams only (in listEntities()).
40  INPUT_STREAMS = 100,
41 
42  /// Pseudo-entity-type for output streams only, i.e., streams
43  /// with no operators downstream (in listEntities()).
44  OUTPUT_STREAMS = 101
45  };
46 
47  /// Return a string naming the entity type.
48  static std::string as_string(Type aType);
49 
50  /// Parse a string as an entity type.
51  /// @param aType the string to parse
52  /// @param allow_plural true if a plural version of the entity types (e.g., "streams" instead of "stream") is allowed
53  /// @throw StreamBaseException if the entity type cannot be parsed
54  static Type as_enum(const std::string &aType, bool allow_plural = false) ;
55  private:
57  ~StreamBaseEntityType() {}
58 };
59 
60 SB_NAMESPACE_END;
61 #endif