SheafSystem  0.0.0.0
wsv_block.cc
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 // Instantiation for class template wsv_list
19 
20 #include "SheafSystem/wsv_block.impl.h"
21 
22 using namespace std;
23 
24 using namespace sheaf; // workaround for MS C++ bug.
25 
26 
27 //=============================================================================
28 // MEMBER FUNCTION SPECIALIZATIONS
29 //=============================================================================
30 
31 // Specialization for T == bool:
32 
33 //$$SCRIBBLE: This specialization requires that all lower
34 // case is used in xlist; eg: "true false" as
35 // opposed to "TRUE FALSE"". This limitation
36 // could be eliminated with a "bool to_bool(string)"
37 // function.
38 
39 template <>
42 operator=(const std::string& xlist)
43 {
44  // Preconditions:
45 
46  // Body:
47 
48  stringstream lval_stream;
49  lval_stream.str(xlist);
50 
51  bool lval;
52  while(lval_stream >> boolalpha >> lval)
53  {
54  push_back(lval);
55  }
56 
57  // Postconditions:
58 
59  ensure(!xlist.empty() ? this->ct() > 0 : true);
60 
61  // Exit:
62 
63  return *this;
64 }
65 
STL namespace.
Namespace for the sheaves component of the sheaf system.
Whitespace-separated-value block; A block of objects of type T that can be conveniently initialized b...
Definition: tuple.h:62