OpFlex Framework  1.7.0
URIBuilder.h
Go to the documentation of this file.
1 /* -*- C++ -*-; c-basic-offset: 4; indent-tabs-mode: nil */
6 /*
7  * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
8  *
9  * This program and the accompanying materials are made available under the
10  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
11  * and is available at http://www.eclipse.org/legal/epl-v10.html
12  */
13 
14 #ifndef OPFLEX_MODB_URIBUILDER_H
15 #define OPFLEX_MODB_URIBUILDER_H
16 
17 #include <string>
18 
19 #include "opflex/modb/URI.h"
20 #include "opflex/modb/MAC.h"
21 
22 namespace opflex {
23 namespace modb {
24 
35 class URIBuilder {
36 public:
40  URIBuilder();
41 
47  URIBuilder(const URI& uri);
48 
52  ~URIBuilder();
53 
60  URIBuilder& addElement(const std::string& elementValue);
61 
67  URIBuilder& addElement(uint32_t elementValue);
68 
74  URIBuilder& addElement(int32_t elementValue);
75 
81  URIBuilder& addElement(uint64_t elementValue);
82 
88  URIBuilder& addElement(int64_t elementValue);
89 
95  URIBuilder& addElement(const MAC& elementValue);
96 
104  URIBuilder& addElement(const URI& elementValue);
105 
109  URI build();
110 
111 private:
112  class URIBuilderImpl;
113  friend class URIBuilderImpl;
114  URIBuilderImpl* pimpl;
115 };
116 
117 /* @} modb */
118 /* @} cpp */
119 
120 } /* namespace modb */
121 } /* namespace opflex */
122 
123 #endif /* OPFLEX_MODB_URIBUILDER_H */
URIBuilder & addElement(const std::string &elementValue)
Add a string-valued path element to the URI path, and URI-escape the value.
Interface definition file for MACs.
~URIBuilder()
Destroy the URI Builder.
URI build()
Build the URI from the path elements and return it.
URIBuilder()
Construct an empty URI builder representing the root element.
Definition: OFLogHandler.h:20
A URI is used to identify managed objects in the MODB.
Definition: URI.h:43
Interface definition file for URIs.
Build a URI using path elements from the root of the tree.
Definition: URIBuilder.h:35
A MAC address is used to identify devices on an ethernet network.
Definition: MAC.h:37