src/core/boolean.h
author Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
Mon, 10 Mar 2008 00:38:48 +0100
changeset 2581 31d4960dc31b
parent 2453 57fe34e08d8d
child 2584 5011c132ed6c
permissions -rw-r--r--
add missing copyright statements.
mathieu@2581
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
mathieu@2581
     2
/*
mathieu@2581
     3
 * Copyright (c) 2008 INRIA
mathieu@2581
     4
 *
mathieu@2581
     5
 * This program is free software; you can redistribute it and/or modify
mathieu@2581
     6
 * it under the terms of the GNU General Public License version 2 as
mathieu@2581
     7
 * published by the Free Software Foundation;
mathieu@2581
     8
 *
mathieu@2581
     9
 * This program is distributed in the hope that it will be useful,
mathieu@2581
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
mathieu@2581
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
mathieu@2581
    12
 * GNU General Public License for more details.
mathieu@2581
    13
 *
mathieu@2581
    14
 * You should have received a copy of the GNU General Public License
mathieu@2581
    15
 * along with this program; if not, write to the Free Software
mathieu@2581
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
mathieu@2581
    17
 *
mathieu@2581
    18
 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
mathieu@2581
    19
 */
mathieu@2453
    20
#ifndef BOOLEAN_H
mathieu@2453
    21
#define BOOLEAN_H
mathieu@2371
    22
mathieu@2438
    23
#include "attribute.h"
mathieu@2451
    24
#include "attribute-helper.h"
mathieu@2371
    25
mathieu@2371
    26
namespace ns3 {
mathieu@2371
    27
mathieu@2441
    28
class Boolean
mathieu@2371
    29
{
mathieu@2371
    30
public:
mathieu@2441
    31
  Boolean ();
mathieu@2441
    32
  Boolean (bool value);
mathieu@2371
    33
  void Set (bool value);
mathieu@2371
    34
  bool Get (void) const;
mathieu@2371
    35
mathieu@2441
    36
  operator bool () const;
mathieu@2372
    37
mathieu@2441
    38
  ATTRIBUTE_CONVERTER_DEFINE (Boolean);
mathieu@2371
    39
private:
mathieu@2371
    40
  bool m_value;
mathieu@2371
    41
};
mathieu@2371
    42
mathieu@2441
    43
std::ostream & operator << (std::ostream &os, const Boolean &value);
mathieu@2441
    44
std::istream & operator >> (std::istream &is, Boolean &value);
mathieu@2410
    45
mathieu@2441
    46
ATTRIBUTE_VALUE_DEFINE (Boolean);
mathieu@2441
    47
ATTRIBUTE_CHECKER_DEFINE (Boolean);
mathieu@2441
    48
ATTRIBUTE_ACCESSOR_DEFINE (Boolean);
mathieu@2371
    49
mathieu@2371
    50
} // namespace ns3
mathieu@2371
    51
mathieu@2453
    52
#endif /* BOOLEAN_H */