src/contrib/net-anim/node-location.cc
changeset 5776 aae948449722
parent 5775 86ff2e00d4ea
child 5777 a7ca957db043
child 5812 bb8a3a22d015
equal deleted inserted replaced
5775:86ff2e00d4ea 5776:aae948449722
     1 /* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
       
     2 /*
       
     3  * Copyright (c) 2009 Georgia Institute of Technology
       
     4  *
       
     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;
       
     8  *
       
     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.
       
    13  *
       
    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
       
    17  *
       
    18  * Author: George Riley<riley@ece.gatech.edu>
       
    19  */
       
    20 
       
    21 #include "node-location.h"
       
    22 
       
    23 namespace ns3 {
       
    24 
       
    25 TypeId 
       
    26 NodeLocation::GetTypeId (void)
       
    27 {
       
    28   static TypeId tid = TypeId ("ns3::NodeLocation")
       
    29     .SetParent<Object> ()
       
    30     .AddAttribute ("Position", "The current position of the mobility model.",
       
    31                    TypeId::ATTR_SET | TypeId::ATTR_GET,
       
    32                    VectorValue (Vector (0.0, 0.0, 0.0)),
       
    33                    MakeVectorAccessor (&NodeLocation::SetLocation,
       
    34                                         &NodeLocation::GetLocation),
       
    35                    MakeVectorChecker ())
       
    36     ;
       
    37   return tid;
       
    38 }
       
    39 
       
    40 NodeLocation::NodeLocation ()
       
    41 {}
       
    42 
       
    43 NodeLocation::~NodeLocation ()
       
    44 {}
       
    45 
       
    46 Vector NodeLocation::GetLocation (void) const
       
    47 {
       
    48   return m_location;
       
    49 }
       
    50 
       
    51 void NodeLocation::SetLocation (const Vector &location)
       
    52 {
       
    53   m_location = location;
       
    54 }
       
    55 
       
    56 } // namespace ns3