Wiselib
|
Each algorithm must have one init() and one destruct() method. More...
Inherited by concepts::Cryptographic_concept, concepts::ModularClustering_concept, concepts::NodeDistanceEstimation_concept, concepts::Position_concept, and concepts::Routing_concept.
Public Member Functions | |
int | init () |
Reset algorithm. | |
int | destruct () |
Turn off algorithm - and thus all Os facets where possible. |
Each algorithm must have one init() and one destruct() method.
Calling init(), the complete state of the algorithm is reset - as if it was newly started (e.g., turning on the radio, deleting previous states, ...). Calling destruct, it should turn off all used components (e.g., turn off radio) and is not allowed to use any Os facet functionality (e.g., no timer registration). In addition, it may have an init() method that expects parameters - where references to Os facet instances can be passed. If so, this method is expected to be called only once during program run-time.
int concepts::BasicAlgorithm_concept::destruct | ( | ) |
Turn off algorithm - and thus all Os facets where possible.
Do not use any Os facet functionality until init() is called.
Reimplemented in concepts::NodeDistanceEstimation_concept, concepts::Position_concept, and concepts::Routing_concept.
int concepts::BasicAlgorithm_concept::init | ( | ) |
Reset algorithm.
Re-init all states, turn on Os facets (if used and enable function is existent).
Reimplemented in concepts::NodeDistanceEstimation_concept, concepts::Position_concept, and concepts::Routing_concept.