class
#include <bn_camera_ptr.h>
camera_ptr std::shared_ptr like smart pointer that retains shared ownership of a camera.
Several camera_
The camera is released when the last remaining camera_
Public static functions
-
static auto create() -> camera_
ptr - Creates a camera_
ptr. -
static auto create(fixed x,
fixed y) -> camera_
ptr - Creates a camera_
ptr. -
static auto create(const fixed_
point& position) -> camera_ ptr - Creates a camera_
ptr. -
static auto create_optional() -> optional<camera_
ptr> - Creates a camera_
ptr. -
static auto create_optional(fixed x,
fixed y) -> optional<camera_
ptr> - Creates a camera_
ptr. -
static auto create_optional(const fixed_
point& position) -> optional<camera_ ptr> - Creates a camera_
ptr.
Constructors, destructors, conversion operators
-
camera_ptr(const camera_
ptr& other) - Copy constructor.
-
camera_ptr(camera_
ptr&& other) noexcept - Move constructor.
- ~camera_ptr()
- Releases the referenced camera if no more camera_
ptr objects reference to it.
Public functions
-
auto operator=(const camera_
ptr& other) -> camera_ ptr& - Copy assignment operator.
-
auto operator=(camera_
ptr&& other) -> camera_ ptr& noexcept - Move assignment operator.
- auto id() const -> int
- Returns the internal id.
- auto x() const -> fixed
- Returns the horizontal position of the camera.
- void set_x(fixed x)
- Sets the horizontal position of the camera.
- auto y() const -> fixed
- Returns the vertical position of the camera.
- void set_y(fixed y)
- Sets the vertical position of the camera.
-
auto position() const -> const fixed_
point& - Returns the position of the camera.
- void set_position(fixed x, fixed y)
- Sets the position of the camera.
-
void set_position(const fixed_
point& position) - Sets the position of the camera.
-
void swap(camera_
ptr& other) - Exchanges the contents of this camera_
ptr with those of the other one.
Friends
-
void swap(camera_
ptr& a, camera_ ptr& b) - Exchanges the contents of a camera_
ptr with those of another one. -
auto operator==(const camera_
ptr& a, const camera_ ptr& b) -> bool defaulted - Default equal operator.
Function documentation
static camera_ ptr bn:: camera_ptr:: create(fixed x,
fixed y)
Creates a camera_
Parameters | |
---|---|
x | Horizontal position of the camera. |
y | Vertical position of the camera. |
Returns | The requested camera_ |
static camera_ ptr bn:: camera_ptr:: create(const fixed_ point& position)
Creates a camera_
Parameters | |
---|---|
position | Position of the camera. |
Returns | The requested camera_ |
static optional<camera_ ptr> bn:: camera_ptr:: create_optional()
Creates a camera_
Returns | The requested camera_ |
---|
static optional<camera_ ptr> bn:: camera_ptr:: create_optional(fixed x,
fixed y)
Creates a camera_
Parameters | |
---|---|
x | Horizontal position of the camera. |
y | Vertical position of the camera. |
Returns | The requested camera_ |
static optional<camera_ ptr> bn:: camera_ptr:: create_optional(const fixed_ point& position)
Creates a camera_
Parameters | |
---|---|
position | Position of the camera. |
Returns | The requested camera_ |
bn:: camera_ptr:: camera_ptr(const camera_ ptr& other)
Copy constructor.
Parameters | |
---|---|
other | camera_ |
bn:: camera_ptr:: camera_ptr(camera_ ptr&& other) noexcept
Move constructor.
Parameters | |
---|---|
other | camera_ |
camera_ ptr& bn:: camera_ptr:: operator=(const camera_ ptr& other)
Copy assignment operator.
Parameters | |
---|---|
other | camera_ |
Returns | Reference to this. |
camera_ ptr& bn:: camera_ptr:: operator=(camera_ ptr&& other) noexcept
Move assignment operator.
Parameters | |
---|---|
other | camera_ |
Returns | Reference to this. |
void bn:: camera_ptr:: set_position(fixed x,
fixed y)
Sets the position of the camera.
Parameters | |
---|---|
x | Horizontal position of the camera. |
y | Vertical position of the camera. |
void bn:: camera_ptr:: swap(camera_ ptr& other)
Exchanges the contents of this camera_
Parameters | |
---|---|
other | camera_ |
void swap(camera_ ptr& a,
camera_ ptr& b)
Exchanges the contents of a camera_
Parameters | |
---|---|
a | First camera_ |
b | Second camera_ |