A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
vector.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19
*/
20
#ifndef NS3_VECTOR_H
21
#define NS3_VECTOR_H
22
23
#include "
attribute.h
"
24
#include "
attribute-helper.h
"
25
32
namespace
ns3 {
33
38
class
Vector3D
39
{
40
public
:
48
Vector3D
(
double
_x,
double
_y,
double
_z);
52
Vector3D
();
56
double
x
;
60
double
y
;
64
double
z
;
65
66
friend
double
CalculateDistance
(
const
Vector3D
&a,
const
Vector3D
&b);
67
friend
std::ostream &
operator <<
(std::ostream &os,
const
Vector3D
&vector);
68
friend
std::istream &
operator >>
(std::istream &is,
Vector3D
&vector);
69
};
70
75
class
Vector2D
76
{
77
public
:
84
Vector2D
(
double
_x,
double
_y);
88
Vector2D
();
92
double
x
;
96
double
y
;
97
98
friend
double
CalculateDistance
(
const
Vector2D
&a,
const
Vector2D
&b);
99
friend
std::ostream &
operator <<
(std::ostream &os,
const
Vector2D
&vector);
100
friend
std::istream &
operator >>
(std::istream &is,
Vector2D
&vector);
101
};
102
108
double
CalculateDistance
(
const
Vector3D
&a,
const
Vector3D
&b);
114
double
CalculateDistance
(
const
Vector2D
&a,
const
Vector2D
&b);
115
116
ATTRIBUTE_HELPER_HEADER
(
Vector3D
);
117
ATTRIBUTE_HELPER_HEADER
(
Vector2D
);
118
128
std::ostream &
operator <<
(std::ostream &os,
const
Vector3D
&vector);
138
std::ostream &
operator <<
(std::ostream &os,
const
Vector2D
&vector);
139
149
std::istream &
operator >>
(std::istream &is,
Vector3D
&vector);
159
std::istream &
operator >>
(std::istream &is,
Vector2D
&vector);
160
161
166
typedef
Vector3D
Vector
;
171
typedef
Vector3DValue
VectorValue
;
176
typedef
Vector3DChecker
VectorChecker
;
177
178
179
// Document these by hand so they go in group attribute_Vector3D
193
ATTRIBUTE_ACCESSOR_DEFINE
(Vector);
194
200
Ptr<const AttributeChecker>
MakeVectorChecker
(
void
);
201
202
}
// namespace ns3
203
204
#endif
/* NS3_VECTOR_H */
ns3::operator>>
std::istream & operator>>(std::istream &is, Angles &a)
initialize a struct Angles from input
Definition:
angles.cc:48
ns3::Vector3D::x
double x
x coordinate of vector
Definition:
vector.h:56
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::Vector2D::operator>>
friend std::istream & operator>>(std::istream &is, Vector2D &vector)
Input streamer.
Definition:
vector.cc:118
ns3::ATTRIBUTE_HELPER_HEADER
ATTRIBUTE_HELPER_HEADER(BleAccessAddress)
ns3::VectorValue
Vector3DValue VectorValue
Vector alias typedef for compatibility with mobility models.
Definition:
vector.h:171
ns3::Vector3D
a 3d vector
Definition:
vector.h:38
ns3::Vector2D::x
double x
x coordinate of vector
Definition:
vector.h:92
ns3::Vector2D::Vector2D
Vector2D()
Create vector vector (0.0, 0.0)
Definition:
vector.cc:70
ns3::Vector2D::y
double y
y coordinate of vector
Definition:
vector.h:96
ns3::CalculateDistance
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Definition:
vector.cc:78
ns3::Vector3D::Vector3D
Vector3D()
Create vector (0.0, 0.0, 0.0)
Definition:
vector.cc:55
ns3::Vector3D::Vector
Vector3D Vector
Definition:
vector.h:166
attribute.h
ns3::AttributeValue, ns3::AttributeAccessor and ns3::AttributeChecker declarations.
ns3::operator<<
std::ostream & operator<<(std::ostream &os, const Angles &a)
print a struct Angles to output
Definition:
angles.cc:42
ns3::Vector2D
a 2d vector
Definition:
vector.h:75
ns3::MakeVectorChecker
Ptr< const AttributeChecker > MakeVectorChecker(void)
Definition:
vector.cc:40
ns3::Vector3D::y
double y
y coordinate of vector
Definition:
vector.h:60
ns3::Vector2D::operator<<
friend std::ostream & operator<<(std::ostream &os, const Vector2D &vector)
Output streamer.
Definition:
vector.cc:113
attribute-helper.h
Declaration of Attribute helper macros.
ns3::VectorChecker
Vector3DChecker VectorChecker
Vector alias typedef for compatibility with mobility models.
Definition:
vector.h:176
ATTRIBUTE_ACCESSOR_DEFINE
#define ATTRIBUTE_ACCESSOR_DEFINE(type)
Define the attribute accessor functions MakeTypeAccessor for class type.
Definition:
attribute-helper.h:152
ns3::Vector3D::operator<<
friend std::ostream & operator<<(std::ostream &os, const Vector3D &vector)
Output streamer.
Definition:
vector.cc:97
ns3::Vector3D::operator>>
friend std::istream & operator>>(std::istream &is, Vector3D &vector)
Input streamer.
Definition:
vector.cc:102
ns3::Vector3D::CalculateDistance
friend double CalculateDistance(const Vector3D &a, const Vector3D &b)
Definition:
vector.cc:78
ns3::Vector3DValue
AttributeValue implementation for Vector3D.
Definition:
vector.h:116
ns3::Vector3DChecker
AttributeChecker implementation for Vector3DValue.
Definition:
vector.h:116
ns3::Vector2D::CalculateDistance
friend double CalculateDistance(const Vector2D &a, const Vector2D &b)
Definition:
vector.cc:88
ns3::Vector3D::z
double z
z coordinate of vector
Definition:
vector.h:64
src
core
model
vector.h
Generated on Wed Jul 6 2016 17:11:26 for ns-3 by
1.8.6