Wiselib
Public Types | Public Member Functions | Public Attributes
concepts::Position_concept Class Reference

Basic Concept for Position Algorithms. More...

Inherits concepts::BasicAlgorithm_concept, concepts::Request_concept, concepts::State_concept, and concepts::StateCallback_concept.

List of all members.

Public Types

enum  State {
  READY, NO_VALUE, INACTIVE, OK,
  FAILED
}
enum  {
  SUCCESS, ERR_UNSPEC, ERR_NOMEM, ERR_BUSY,
  ERR_NOTIMPL, ERR_NETDOWN, ERR_HOSTUNREACH
}
enum  StateValues { READY, NO_VALUE, INACTIVE }

Public Member Functions

int init ()
 Reset algorithm.
int destruct ()
 Turn off algorithm.
value_t operator() ()
 Return current position.
int state ()
 Only State.
int register_state_callback (T *obj_pnt)
 Only State Callback.
int unregister_state_callback (int)
 Unregister state-changed callback.

Public Attributes

typedef value_t
 Define position type.
typedef OsModel
 Type of Os Concept which has been set.

Detailed Description

Basic Concept for Position Algorithms.

The position is a refinement of a Request, and returns either the current position (of type value_t) via operator()() (as defined in Request).

Since a position may also be unknown, it also implements State or State Callback to indicate whether a correct position is available (state must be X::READY). The concrete implementation (state or state callback) is implementation dependent, and must be given in documentation. Of course, a model may implement both state and state callback.


Member Enumeration Documentation

anonymous enum [inherited]
Enumerator:
SUCCESS 

Default return value of success.

ERR_UNSPEC 

Unspecified error value - if no other fits.

ERR_NOMEM 

Out of memory.

ERR_BUSY 

Device or resource busy - try again later.

ERR_NOTIMPL 

Function not implemented.

ERR_NETDOWN 

Network is down.

ERR_HOSTUNREACH 

No route to host.

Enumerator:
READY 

Ready for returning a value.

NO_VALUE 

There is no value available.

INACTIVE 

Not yet enabled - implementation is inactive and cannot return meaningful values.

OK 

Only State Callback. When callback registration was successful.

FAILED 

Only State Callback. When callback registration failed.

Reimplemented from concepts::State_concept.

Enumerator:
READY 

Ready for asking for data.

NO_VALUE 

Currently no data available.

INACTIVE 

Currently inactive - so no values available.


Member Function Documentation

int concepts::Position_concept::destruct ( )

Turn off algorithm.

State is set to INACTIVE.

Reimplemented from concepts::BasicAlgorithm_concept.

int concepts::Position_concept::init ( )

Reset algorithm.

Known position (if so) is lost, state is set back to NO_VALUE.

Reimplemented from concepts::BasicAlgorithm_concept.

value_t concepts::Position_concept::operator() ( )

Return current position.

Reimplemented from concepts::Request_concept.

int concepts::Position_concept::register_state_callback ( T *  obj_pnt)

Only State Callback.

Register state changed callback function - method signature must be void RCV_METHOD_NAME(int state). Returns either OK or FAILED.

Reimplemented from concepts::StateCallback_concept.

int concepts::Position_concept::state ( )

Only State.

Return current state - can either be READY, NO_VALUE, or INACTIVE.

Reimplemented from concepts::State_concept.

int concepts::StateCallback_concept::unregister_state_callback ( int  ) [inherited]

Unregister state-changed callback.


Member Data Documentation

Type of Os Concept which has been set.

Define position type.

Reimplemented from concepts::Request_concept.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines