mathieu@2581: /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ mathieu@2581: /* mathieu@2581: * Copyright (c) 2008 INRIA mathieu@2581: * mathieu@2581: * This program is free software; you can redistribute it and/or modify mathieu@2581: * it under the terms of the GNU General Public License version 2 as mathieu@2581: * published by the Free Software Foundation; mathieu@2581: * mathieu@2581: * This program is distributed in the hope that it will be useful, mathieu@2581: * but WITHOUT ANY WARRANTY; without even the implied warranty of mathieu@2581: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the mathieu@2581: * GNU General Public License for more details. mathieu@2581: * mathieu@2581: * You should have received a copy of the GNU General Public License mathieu@2581: * along with this program; if not, write to the Free Software mathieu@2581: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA mathieu@2581: * mathieu@2581: * Authors: Mathieu Lacage mathieu@2581: */ mathieu@2453: #ifndef BOOLEAN_H mathieu@2453: #define BOOLEAN_H mathieu@2371: mathieu@2438: #include "attribute.h" mathieu@2451: #include "attribute-helper.h" mathieu@2371: mathieu@2371: namespace ns3 { mathieu@2371: mathieu@2584: /** mathieu@2584: * \brief Hold a bool native type mathieu@2584: * mathieu@2928: * \anchor bool mathieu@2928: * mathieu@2584: * This class can be used to hold bool variables mathieu@2584: * which must go through the Attribute system. mathieu@2584: */ mathieu@2441: class Boolean mathieu@2371: { mathieu@2371: public: mathieu@2441: Boolean (); mathieu@2441: Boolean (bool value); mathieu@2371: void Set (bool value); mathieu@2371: bool Get (void) const; mathieu@2371: mathieu@2441: operator bool () const; mathieu@2372: mathieu@2441: ATTRIBUTE_CONVERTER_DEFINE (Boolean); mathieu@2371: private: mathieu@2371: bool m_value; mathieu@2371: }; mathieu@2371: mathieu@2441: std::ostream & operator << (std::ostream &os, const Boolean &value); mathieu@2441: std::istream & operator >> (std::istream &is, Boolean &value); mathieu@2371: mathieu@2441: ATTRIBUTE_VALUE_DEFINE (Boolean); mathieu@2441: ATTRIBUTE_CHECKER_DEFINE (Boolean); mathieu@2441: ATTRIBUTE_ACCESSOR_DEFINE (Boolean); mathieu@2371: mathieu@2371: } // namespace ns3 mathieu@2371: mathieu@2453: #endif /* BOOLEAN_H */