ns-3 PLC model
model/plc-outlet.h
00001 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
00002 /*
00003  * Copyright (c) 2012 University of British Columbia, Vancouver
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  * Author: Alexander Schloegl <alexander.schloegl@gmx.de>
00019  */
00020 
00021 #ifndef PLC_OUTLET_H_
00022 #define PLC_OUTLET_H_
00023 
00024 #include <set>
00025 #include "ns3/object.h"
00026 #include "ns3/plc-defs.h"
00027 #include "ns3/plc-edge.h"
00028 #include "ns3/plc-node.h"
00029 #include "ns3/plc-backbone.h"
00030 
00031 namespace ns3 {
00032 
00033 class PLC_Node;
00034 class PLC_RxInterface;
00035 
00046 class PLC_Outlet : public Object
00047 {
00048 
00049 public:
00056         PLC_Outlet(Ptr<PLC_Node> node, Ptr<PLC_Impedance> impedance = 0);
00057         ~PLC_Outlet() {}
00058 
00059         static TypeId GetTypeId(void);
00060 
00068         void RegisterBackboneBranch(Ptr<PLC_BackboneBranch> bb_branch);
00069 
00077         void SetImpedance(Ptr<PLC_Impedance> impedance, bool updateImmediately = true);
00078 
00082         Ptr<PLC_Impedance> GetImpedance(void);
00083 
00087         bool IsTimeVariant(void);
00088 
00092         Ptr<PLC_Node> GetNode(void) { return m_node; }
00093 
00099         void SetRxInterface(Ptr<PLC_RxInterface> interface);
00100 
00104         Ptr<PLC_RxInterface> GetRxInterface(void);
00105 
00109         void Lock(void) const { m_mutex.Lock(); }
00110         void Unlock(void) const { m_mutex.Unlock(); }
00111 
00112 private:
00113         virtual void DoDispose(void);
00114 
00115         mutable PLC_Mutex m_mutex;
00116         void AcquaintAffectedInstances(void);
00117 
00118         Ptr<PLC_Node> m_node;
00119         Ptr<PLC_RxInterface> m_rxInterface;
00120         std::set<Ptr<PLC_BackboneBranch> > m_registered_backbone_branches;
00121 };
00122 
00123 }
00124 
00125 #endif /* PLC_OUTLET_H_ */
 All Classes Functions Variables Enumerations