This class is available for the OPUS Blackboard API. The initial OPUS 2.0 release is described here
Constructors:
Data_id( ) | |
~Data_id( ) |
Methods:
clone( ) | returns a copy of this object |
name( ) | gets the field name |
Description
Data_id objects manage the DATA_ID portion of an OSF.
Derived from
Example
#include <iostream> #include "file_osf_bb.h" #include "file_osf.h" #include "dataset.h" #include "data_id.h" #include "time_stamp.h" #include "opus_lock.h" using namespace std; // The following example uses the File OSF Blackboard to find // an OSF on disk, then delete it. int main(int argc, char* argv[]) { File_osf_bb* obb = new File_osf_bb("/home/opus/sci_osfs/"); Osf* fosf = obb->new_osf(); // padded except // for time stamp fosf->search_fill_all(); // place search characters // in all fields Dataset* dat = new Dataset("N12345678"); // set DATASET field fosf->set_field(dat); delete dat; Data_id* did = new Data_id("SCI"); // set DATA_ID field fosf->set_field(did); delete did; vector<Entry*> res; if (obb->search(fosf, res)) { // search for OSF Opus_lock* lck = 0; try { // attempt lock on OSF lck = obb->lock_entry(res[0]); obb->erase(res[0]); // delete it cout << "Deleted OSF: " << fosf->str() << endl; } catch(...) { cout << "Failed to delete OSF: " << res[0]->str() << endl; } delete lck; // release & delete delete res[0]; } else { cout << "Could not find OSF: " << fosf->str() << endl; } delete fosf; delete obb; return(0); }
See Also:
Data_id::Data_id - The Data_id constructor.
Synopsis
Data_id::Data_id( const string& s) // I - DATA_ID string Data_id::Data_id( const Data_id& di) // I - object to initialize from
Description
This method constructs a new Data_id object, and assigns it the value of the string argument. The default size of this field is three characters and it uses the default pad character for Field objects.
Exceptions Thrown
Data_id::~Data_id - The Data_id destructor.
Synopsis
Data_id::~Data_id()
Description
This method destroys the object.
Exceptions Thrown
Data_id::clone - Create a copy of this object.
Synopsis
Field* Data_id::clone() const
Description
This method creates a new Data_id object, initialized with this object, off the heap and returns a pointer to it. The client should delete the new object when it is no longer needed.
Returns
A pointer to the new Data_id object initialized by this object.
Exceptions Thrown
Data_id::name - Get the field name
Synopsis
string Data_id::name() const
Description
This method returns the name of the field, "DATA_ID".
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