Loading...
Searching...
No Matches
satellite-mobility-observer.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd
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: Sami Rantanen <sami.rantanen@magister.fi>
19 */
20
21#ifndef SATELLITE_MOBILITY_OBSERVER_H
22#define SATELLITE_MOBILITY_OBSERVER_H
23
24#include "geo-coordinate.h"
27
28#include "ns3/object.h"
29
30#include <string>
31
32namespace ns3
33{
34
45class SatMobilityObserver : public Object
46{
47 public:
52 static TypeId GetTypeId(void);
53
58
66 SatMobilityObserver(Ptr<SatMobilityModel> ownMobility,
67 Ptr<SatMobilityModel> geoSatMobility,
68 bool isRegenerative = false);
69
73 virtual ~SatMobilityObserver();
74
78 virtual void DoDispose(void);
79
87 void ObserveTimingAdvance(Ptr<PropagationDelayModel> ownDelayModel,
88 Ptr<PropagationDelayModel> anotherDelayModel,
89 Ptr<SatMobilityModel> anotherMobility);
90
96 double GetElevationAngle(void);
97
103 double GetVelocity(void);
104
110 Time GetTimingAdvance(void);
111
118 typedef void (*PropertyChangedCallback)(Ptr<const SatMobilityObserver> mobilityObserver);
119
120 private:
124 void NotifyPropertyChange(void) const;
125
130
134 void UpdateTimingAdvance();
135
140
147 void PositionChanged(std::string context, Ptr<const SatMobilityModel> position);
148
152 TracedCallback<Ptr<const SatMobilityObserver>> m_propertyChangeTrace;
153
154 Ptr<SatMobilityModel> m_ownMobility;
155 Ptr<SatMobilityModel> m_anotherMobility;
156 Ptr<SatMobilityModel> m_geoSatMobility;
157 Ptr<PropagationDelayModel> m_ownProgDelayModel;
158 Ptr<PropagationDelayModel> m_anotherProgDelayModel;
159
160 bool m_initialized; // flag for GetElevationAngle
161 bool m_updateElevationAngle; // flag for GetElevationAngle
162 bool m_updateTimingAdvance; // flag for GetTimingAdvance
172};
173
174} // namespace ns3
175
176#endif /* SATELLITE_MOBILITY_OBSERVER_H */
void(* PropertyChangedCallback)(Ptr< const SatMobilityObserver > mobilityObserver)
Callback signature for PropertyChanged trace source.
Ptr< SatMobilityModel > m_geoSatMobility
virtual ~SatMobilityObserver()
Destructor of the mobility observer.
virtual void DoDispose(void)
Dispose of this class instance.
void UpdateElevationAngle()
Update elevation angle.
SatMobilityObserver()
Default constructor of the mobility observer (should not be called).
void ObserveTimingAdvance(Ptr< PropagationDelayModel > ownDelayModel, Ptr< PropagationDelayModel > anotherDelayModel, Ptr< SatMobilityModel > anotherMobility)
Enable observing of the timing advance.
Time GetTimingAdvance(void)
Get timing advance.
void PositionChanged(std::string context, Ptr< const SatMobilityModel > position)
Listener (callback) for mobility position changes.
void SatelliteStatusChanged()
Do actions needed when satellite position is changed.
void UpdateTimingAdvance()
Update timing advance.
double GetVelocity(void)
Get velocity of own movement (speed).
static TypeId GetTypeId(void)
Get the type ID.
Ptr< SatMobilityModel > m_anotherMobility
void NotifyPropertyChange(void) const
Notify listeners about some property is changed.
double GetElevationAngle(void)
Get elevation angle.
TracedCallback< Ptr< const SatMobilityObserver > > m_propertyChangeTrace
Used to alert subscribers that a change in some observed property has occurred.
Ptr< PropagationDelayModel > m_anotherProgDelayModel
Ptr< PropagationDelayModel > m_ownProgDelayModel
Ptr< SatMobilityModel > m_ownMobility
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.