Instigate Open Source Documentation

instigate::geometry::concept::point::interface< T > Struct Template Reference

Interface for the Concept Point. More...

#include <concept_point.hpp>

Inheritance diagram for instigate::geometry::concept::point::interface< T >:
instigate::default_constructible::interface< T > instigate::assignable::interface< T >

List of all members.

Coordinates



typedef T::coordinate_type coordinate_type
 Type of the coordinate.
static void set_x (T &p, const coordinate_type &v)
 Changes the x coordinate of a point.
static void set_y (T &p, const coordinate_type &v)
 Changes the y coordinate of a point.
static coordinate_type get_x (const T &p)
 Returns the x coordinate of a point.
static coordinate_type get_y (const T &p)
 Returns the y coordinate of a point.

Detailed Description

template<typename T>
struct instigate::geometry::concept::point::interface< T >

Interface for the Concept Point.

This is a "non-intrusive" interface for concept::point. Any type, which conceptually is a Point (i.e. has x/y coordinates that can be accessed/modified), can become a model of this concept, i.e. algorithms of this library will be applicable to it without need of any adaptor class. For that it is enough to provided this interface for that class by specializing this template structure with it and providing definitions for associated types and basic operations.

Note:
The default implementation is chosen so that the class instigate::geometry::point is automatically a model of this concept, without any specialization.
Refinement of
  • instigate::stl::concept::default_constructible
  • instigate::stl::concept::assignable
Models:
Todo:
make template specialization so that any std::pair<T,T> is also a model of this concept if (and only if) T is a numeric type

Member Typedef Documentation

template<typename T>
typedef T::coordinate_type instigate::geometry::concept::point::interface< T >::coordinate_type

Type of the coordinate.

This must be a numeric type.


Member Function Documentation

template<typename T>
static coordinate_type instigate::geometry::concept::point::interface< T >::get_x ( const T &  p  )  [inline, static]

Returns the x coordinate of a point.

Parameters:
[in] p is an rvalue of type T
Returns:
the x coordinate of the point p
Complexity
Complexity of this function must be O(1).
template<typename T>
static coordinate_type instigate::geometry::concept::point::interface< T >::get_y ( const T &  p  )  [inline, static]

Returns the y coordinate of a point.

Parameters:
[in] p is an rvalue of type T
Returns:
the y coordinate of the point p
Complexity
Complexity of this function must be O(1).
template<typename T>
static void instigate::geometry::concept::point::interface< T >::set_x ( T &  p,
const coordinate_type v 
) [inline, static]

Changes the x coordinate of a point.

Parameters:
[in] p is an lvalue of type T
[in] v is the new value for the x coordinate of p
Postcondition:
get_x(p) == v
Complexity
Complexity of this function must be O(1).
template<typename T>
static void instigate::geometry::concept::point::interface< T >::set_y ( T &  p,
const coordinate_type v 
) [inline, static]

Changes the y coordinate of a point.

Parameters:
[in] p is an lvalue of type T
[in] v is the new value for the y coordinate of p
Postcondition:
get_y(p) == v
Complexity
Complexity of this function must be O(1).

The documentation for this struct was generated from the following file:


© Instigate CJSC, Open Source