flow  3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
named.h
Go to the documentation of this file.
1 #if !defined(FLOW_NAMED_H)
2  #define FLOW_NAMED_H
3 
4 #include <string>
5 
9 
10 namespace flow
11 {
12 
18 class named
19 {
20  std::string d_name;
21 
22 public:
26  named(const std::string& name_r) : d_name(name_r) {}
27 
29  named(named&& name_rr) : d_name(std::move(name_rr.d_name)) {}
30 
32  named(const named& name_r) : d_name(name_r.d_name) {}
33 
34  virtual ~named() {}
35 
37  virtual const std::string& name() const { return d_name; }
38 
42  virtual std::string rename(const std::string& name_r) { std::string old = d_name; d_name = name_r; return old; }
43 };
44 
45 }
46 
47 #endif
48 
49 /*
50  (C) Copyright Thierry Seegers 2010-2012. Distributed under the following license:
51 
52  Boost Software License - Version 1.0 - August 17th, 2003
53 
54  Permission is hereby granted, free of charge, to any person or organization
55  obtaining a copy of the software and accompanying documentation covered by
56  this license (the "Software") to use, reproduce, display, distribute,
57  execute, and transmit the Software, and to prepare derivative works of the
58  Software, and to permit third-parties to whom the Software is furnished to
59  do so, all subject to the following:
60 
61  The copyright notices in the Software and this entire statement, including
62  the above license grant, this restriction and the following disclaimer,
63  must be included in all copies of the Software, in whole or in part, and
64  all derivative works of the Software, unless such copies or derivative
65  works are solely in the form of machine-executable object code generated by
66  a source language processor.
67 
68  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70  FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
71  SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
72  FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
73  ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
74  DEALINGS IN THE SOFTWARE.
75 */