2008-04-09 11:46:04 -07:00
|
|
|
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
|
|
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2008 INRIA
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
|
* published by the Free Software Foundation;
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*
|
|
|
|
|
* Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
|
|
|
|
|
*/
|
|
|
|
|
#include "pointer.h"
|
|
|
|
|
|
|
|
|
|
namespace ns3 {
|
|
|
|
|
|
2008-04-17 13:42:25 -07:00
|
|
|
PointerValue::PointerValue ()
|
2008-04-09 11:46:04 -07:00
|
|
|
: m_value ()
|
|
|
|
|
{}
|
|
|
|
|
|
2008-04-17 13:42:25 -07:00
|
|
|
PointerValue::PointerValue (Ptr<Object> object)
|
2008-04-09 11:46:04 -07:00
|
|
|
: m_value (object)
|
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
void
|
2008-04-17 13:42:25 -07:00
|
|
|
PointerValue::SetObject (Ptr<Object> object)
|
2008-04-09 11:46:04 -07:00
|
|
|
{
|
|
|
|
|
m_value = object;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Ptr<Object>
|
2008-04-17 13:42:25 -07:00
|
|
|
PointerValue::GetObject (void) const
|
2008-04-09 11:46:04 -07:00
|
|
|
{
|
|
|
|
|
return m_value;
|
|
|
|
|
}
|
|
|
|
|
|
2008-04-17 13:42:25 -07:00
|
|
|
Ptr<AttributeValue>
|
|
|
|
|
PointerValue::Copy (void) const
|
2008-04-09 11:46:04 -07:00
|
|
|
{
|
2008-04-17 13:42:25 -07:00
|
|
|
return Create<PointerValue> (*this);
|
2008-04-09 11:46:04 -07:00
|
|
|
}
|
2008-04-17 13:42:25 -07:00
|
|
|
std::string
|
|
|
|
|
PointerValue::SerializeToString (Ptr<const AttributeChecker> checker) const
|
2008-04-09 11:46:04 -07:00
|
|
|
{
|
2008-04-17 13:42:25 -07:00
|
|
|
std::ostringstream oss;
|
|
|
|
|
oss << m_value;
|
|
|
|
|
return oss.str ();
|
2008-04-09 11:46:04 -07:00
|
|
|
}
|
|
|
|
|
|
2008-04-17 13:42:25 -07:00
|
|
|
bool
|
|
|
|
|
PointerValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker)
|
|
|
|
|
{
|
|
|
|
|
NS_FATAL_ERROR ("It is not possible to deserialize a pointer.");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2008-04-09 11:46:04 -07:00
|
|
|
|
|
|
|
|
} // namespace ns3
|