00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2008 INRIA 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> 00019 */ 00020 #include "pointer.h" 00021 00022 namespace ns3 { 00023 00024 PointerValue::PointerValue () 00025 : m_value () 00026 {} 00027 00028 PointerValue::PointerValue (Ptr<Object> object) 00029 : m_value (object) 00030 {} 00031 00032 void 00033 PointerValue::SetObject (Ptr<Object> object) 00034 { 00035 m_value = object; 00036 } 00037 00038 Ptr<Object> 00039 PointerValue::GetObject (void) const 00040 { 00041 return m_value; 00042 } 00043 00044 Ptr<AttributeValue> 00045 PointerValue::Copy (void) const 00046 { 00047 return Create<PointerValue> (*this); 00048 } 00049 std::string 00050 PointerValue::SerializeToString (Ptr<const AttributeChecker> checker) const 00051 { 00052 std::ostringstream oss; 00053 oss << m_value; 00054 return oss.str (); 00055 } 00056 00057 bool 00058 PointerValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) 00059 { 00060 NS_FATAL_ERROR ("It is not possible to deserialize a pointer."); 00061 return false; 00062 } 00063 00064 } // namespace ns3