This class is available for the OPUS Blackboard API. The initial OPUS 2.0 release is described here
Constructors:
Time_entry( ) | |
~Time_entry( ) |
Methods:
clone( ) | create copy of this Time_entry |
Data Members:
static const Field::PAD TIME_PADC; // Field pad character static const int ABS_TIME_IDENT; // unique field ID's static const int DELTA_TIME_IDENT;
Description
A Time_entry object contains either an Absolute_time or Delta_time object, depending on which blackboard it will be applied. Each time blackboard provides methods for creating the correct type of Time_entry to be used with their search methods. Time_entry's are not stored on the time blackboards-- rather, they are used to pass time values to the search method of the appropriate time blackboard to test whether the time encoded in their fields is in the past or the future.
Derived from
Example
#include <iostream> #include <vector> #include "absolute_time_bb.h" #include "entry.h" #include "time_entry.h" using namespace std; // The following example uses the Absolute Time Blackboard to // determine whether it is past noon yet. int main(int argc, char* argv[]) { Absolute_time_bb abb; Time_entry* t_ent = abb.new_time("12:10:00"); // place noon // today in new // time entry vector<Entry*> results; // results vector if (abb.search(t_ent, results)) { // it's past noon cout << "It's past noon." << endl; delete results[0]; // delete result } else { cout << "It's not noon yet." << endl; } delete t_ent; // delete search // condition return(0); }
See Also:
Time_entry::Time_entry - The Time_entry constructor.
Synopsis
Time_entry::Time_entry( const Field* e) // I - Absolute_time or Delta_time // field Time_entry::Time_entry( const Time_entry& e) // I - Time_entry to // initialize from
Description
The constructor takes either an Absolute_time or Delta_time object and places a copy in the object.
Exceptions Thrown
Example
Absolute_time* at = new Absolute_time(); // create with current time Time_entry* te = new Time_entry(at); // create Time_entry for // use with Absolute Time // Blackboard delete at; // no longer needed
Time_entry::~Time_entry - The Time_entry destructor.
Synopsis
Time_entry::~Time_entry()
Description
This method destroys the object.
Exceptions Thrown
Time_entry::clone - Create a copy of this object.
Synopsis
Entry* Time_entry::clone() const
Description
This method creates a new Time_entry object, initialized by this object, off the heap and returns a pointer to the object. The client should delete the returned object when it is no longer needed.
Returns
A pointer to the new Time_entry initialized by this object.
Exceptions Thrown
Copyright © 1997-2000 The Association of Universities for
Research in Astronomy, Inc. All Rights Reserved.
For more information, contact opushelp@stsci.edu
Last modified: 25 April 2000