This class is available for the OPUS Blackboard API. The initial OPUS 2.0 release is described here
Constructors:
Node( ) | |
~Node( ) |
Methods:
clone( ) | returns a copy of this object |
name( ) | gets the field name |
Description
Node objects contain the host name on which the process that owns the PSTAT is running. This field, along with the Pid field, uniquely identify a PSTAT on the PSTAT blackboard.
Derived from
Example
#include <iostream> #include "file_pstat_bb.h" #include "file_pstat.h" #include "pid.h" #include "node.h" #include "opus_lock.h" using namespace std; // The following example uses the File PSTAT Blackboard to find // an application's PSTAT on disk, then delete it. int main(int argc, char* argv[]) { // constructor takes // OPUS_HOME_DIR path File_pstat_bb* pbb = new File_pstat_bb("/home/opus/pstats/"); Pstat* fpstat = pbb->new_pstat(); // padded except for Pid & // Node Pid* pid = new Pid(123); // replace PID in PSTAT fpstat->set_field(pid); delete pid; Node* node = new Node("foo"); // replace NODE in PSTAT fpstat->set_field(node); delete node; fpstat->search_fill(); // place search characters in // remaining fields vector<Entry*> res; if (pbb->search(fpstat, res)) { // search for PSTAT Opus_lock* lck = 0; try { // attempt lock on PSTAT lck = pbb->lock_entry(res[0]); pbb->erase(res[0]); // delete it cout << "Deleted PSTAT: " << fpstat->str() << endl; } catch(...) { cout << "Failed to delete PSTAT: " << res[0]->str() << endl; } delete lck; // release & delete delete res[0]; } else { cout << "Could not find PSTAT: " << fpstat->str() << endl; } delete fpstat; delete pbb; return(0); }
See Also:
Node::Node - The Node constructor.
Synopsis
Node::Node( const string& s) // I - node name Node::Node( const Node& di) // I - object to initialize from
Description
This method constructs a new Node object using the supplied node name. If no node is specified, the host name is used to initialize the object.
Exceptions Thrown
Node::~Node - The Node destructor.
Synopsis
Node::~Node()
Description
This method destroys the object.
Exceptions Thrown
Node::clone - Create a copy of this object.
Synopsis
Field* Node::clone() const
Description
This method creates a new Node object, initialized by this object, off the heap and returns a pointer to the new object. The client should delete the returned object when it is no longer needed.
Returns
A pointer to the new Node object initialized by this object.
Exceptions Thrown
Node::name - Get the field name
Synopsis
string Node::name() const
Description
This method returns the name of the field, "NODE".
Returns
string field name
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