SheafSystem  0.0.0.0
wsv_block.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class wsv_block
19 
20 #ifndef WSV_BLOCK_H
21 #define WSV_BLOCK_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef BLOCK_H
28 #include "SheafSystem/block.h"
29 #endif
30 
31 #ifndef STD_STRING_H
32 #include "SheafSystem/std_string.h"
33 #endif
34 
35 namespace sheaf
36 {
37 
42 template <typename T>
43 class SHEAF_DLL_SPEC wsv_block : public block<T>
44 {
45 
46 public:
47 
52  wsv_block();
53 
58  wsv_block(const wsv_block& xother);
59 
63  ~wsv_block();
64 
68  wsv_block(const char* xlist);
69 
73  wsv_block(const std::string& xlist);
74 
75  using block<T>::operator=;
76 
81  wsv_block& operator=(const wsv_block& xother);
82 
87  wsv_block& operator=(const std::string& xlist);
88 
93  wsv_block& operator=(const char* xlist);
94 
98  bool invariant() const;
99 
100  using block<T>::push_back;
101 
105  void push_back(const wsv_block& xother);
106 
107 };
108 
109 
110 //=============================================================================
111 // MEMBER FUNCTION SPECIALIZATIONS
112 //=============================================================================
113 
114 // Specialization for T == bool:
115 
116 //$$SCRIBBLE: This specialization requires that all lower
117 // case is used in xlist; eg: "true false" as
118 // opposed to "TRUE FALSE"". This limitation
119 // could be eliminated with a "bool to_bool(string)"
120 // function.
121 
122 template <>
123 SHEAF_DLL_SPEC
124 wsv_block<bool>&
126 operator=(const std::string& xlist);
127 
128 // ===========================================================
129 // NON-MEMBER FUNCTIONS
130 // ===========================================================
131 
132 } // namespace sheaf
133 
134 #endif // ifndef WSV_BLOCK_H
wsv_block & operator=(const wsv_block &xother)
Sets the contents of this to the contents of whitespace-separated list xlist.
void push_back(const_reference_type item)
Insert item at the end of the items in the auto_block.
Namespace for the sheaves component of the sheaf system.