CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DDString.cc
Go to the documentation of this file.
2 
3 #include <utility>
4 
6 
7 DDString::DDString(const DDName& name) : DDBase<DDName, std::unique_ptr<std::string>>() { create(name); }
8 
9 DDString::DDString(const DDName& name, std::unique_ptr<std::string> vals) { create(name, std::move(vals)); }
10 
11 std::ostream& operator<<(std::ostream& os, const DDString& cons) {
12  os << "DDString name=" << cons.name();
13 
14  if (cons.isDefined().second) {
15  os << " val=" << cons.value();
16  } else {
17  os << " constant is not yet defined, only declared.";
18  }
19  return os;
20 }
Definition: DDBase.h:10
def_type isDefined() const
Definition: DDBase.h:90
const N & name() const
Definition: DDBase.h:59
const std::string & value() const
return the first stored value; does not check boundaries!
Definition: DDString.h:28
DDName is used to identify DDD entities uniquely.
Definition: DDName.h:17
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
a named constant corresponding to the DDL-XML tag &lt;Constant&gt; and &lt;ConstantsVector&gt; ...
Definition: DDString.h:16
DDString()
an uninitialized constant; one can assign an initialized constant to make it valid ...
Definition: DDString.cc:5
def move
Definition: eostools.py:511
void create(const DDName &name, std::unique_ptr< std::string >vals)
Definition: DDBase.h:96