1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
3 * Copyright (c) 2008 INRIA
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
23 #include "attribute.h"
24 #include "attribute-helper.h"
31 * \brief Hold a bool native type
35 * This class can be used to hold bool variables
36 * which must go through the Attribute system.
38 class BooleanValue : public AttributeValue
42 BooleanValue (bool value);
43 void Set (bool value);
44 bool Get (void) const;
46 bool GetAccessor (T &v) const;
48 operator bool () const;
50 virtual Ptr<AttributeValue> Copy (void) const;
51 virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const;
52 virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker);
58 bool BooleanValue::GetAccessor (T &v) const
64 std::ostream & operator << (std::ostream &os, const BooleanValue &value);
66 ATTRIBUTE_CHECKER_DEFINE (Boolean);
67 ATTRIBUTE_ACCESSOR_DEFINE (Boolean);
71 #endif /* BOOLEAN_H */