Dripline-Cpp  v2.10.11
Dripline Implementation in C++
specifier.hh
Go to the documentation of this file.
1 /*
2  * specifier.hh
3  *
4  * Created on: Feb 18, 2016
5  * Author: nsoblath
6  */
7 
8 #ifndef DRIPLINE_SPECIFIER_HH_
9 #define DRIPLINE_SPECIFIER_HH_
10 
11 #include "dripline_api.hh"
12 
13 #include "member_variables.hh"
14 
15 #include <deque>
16 #include <string>
17 
18 namespace dripline
19 {
20 
27  class DRIPLINE_API routing_key : public std::deque< std::string >
28  {
29  public:
30  typedef std::deque< std::string > container_type;
31 
32  public:
33  routing_key( const std::string& a_rk = "" );
34  routing_key( const routing_key& ) = default;
35  routing_key( routing_key&& ) = default;
36  virtual ~routing_key() = default;
37 
38  routing_key& operator=( const routing_key& ) = default;
40 
42  void parse( const std::string& a_rk );
44  std::string to_string() const;
45 
46  private:
47  void add_next( const std::string& a_addr );
48 
49  public:
50  static const char f_node_separator = '.';
51 
52  };
53 
60  class DRIPLINE_API specifier : public std::deque< std::string >
61  {
62  public:
63  typedef std::deque< std::string > container_type;
64 
65  public:
66  specifier( const std::string& a_unparsed = "" );
67  specifier( const specifier& a_orig );
68  specifier( specifier&& a_orig );
69  virtual ~specifier();
70 
71  const specifier& operator=( const specifier& a_orig );
72  const specifier& operator=( specifier&& a_orig );
73 
75  void parse( const std::string& a_unparsed );
77  void reparse();
79  std::string to_string() const;
80 
82  mv_referrable( std::string, unparsed );
83 
84  private:
85  void add_next( const std::string& a_addr );
86 
87  public:
88  static const char f_node_separator = '.';
89 
90  };
91 
92  inline void specifier::reparse()
93  {
94  parse( f_unparsed );
95  return;
96  }
97 
98 
99 } /* namespace dripline */
100 
101 #endif /* DRIPLINE_SPECIFIER_HH_ */
Parses routing keys and stores the tokenized information.
Definition: specifier.hh:28
routing_key(const routing_key &)=default
routing_key & operator=(const routing_key &)=default
routing_key(routing_key &&)=default
std::deque< std::string > container_type
Definition: specifier.hh:30
virtual ~routing_key()=default
routing_key & operator=(routing_key &&)=default
Parses specifiers and stores the tokenized information.
Definition: specifier.hh:61
void reparse()
Parses the contents of f_unparsed.
Definition: specifier.hh:92
std::deque< std::string > container_type
Definition: specifier.hh:63
void parse(const std::string &a_unparsed)
Parse a new specifier.
Definition: specifier.cc:94
#define DRIPLINE_API
Definition: dripline_api.hh:34
std::string to_string(op_t an_op)
Gives the human-readable version of a message operation.