code::WebIndex Class Reference

Inheritance diagram for code::WebIndex:

code::InMemoryIndex code::Index code::IndexBase code::ActionSource List of all members.

Detailed Description

A self-updating InMemoryIndex which periodically checks its source URL for new content.

These periodic checks happen whenever EventHandler::handle_events() is called. They can also be forced directly via checkForNew().

Author:
Charles Kerr
Version:
Id
code_WebIndex.h,v 1.2 2006/02/27 19:34:52 lakshman Exp


Public Types

typedef std::vector< std::string > selections_t
typedef std::vector< Index::RecordVolumeRecords
 NextTime
 Step toward the next available time.
 PreviousTime
 Step toward the previously available time.
 NextSubType
 Step up to the next subtype.
 PreviousSubType
 Step up to the previous subtype.
enum  Direction { NextTime, PreviousTime, NextSubType, PreviousSubType }
 The directions in which you can navigate starting from a valid Index::Record. More...

Public Member Functions

 WebIndex (const URL &website, const IndexBase &baseClass=IndexBase())
 The URL here needs to be something like: http://venus.protect.nssl:8080/?source=KABR We'll add webIndex/WebIndexServlet etc.
virtual ~WebIndex ()
bool checkForNew ()
bool isValid () const
virtual Record getRecord (const selections_t &sel) const
virtual Record getRecord (const selections_t &selection) const =0
 Get the record matching the selection criteria.
virtual size_t getRecords (std::vector< Record > *records) const
size_t getRecords (const selections_t &selection, std::vector< Record > *records, std::vector< std::string > *next_selection=0) const
 Obtain all the records that match the selections passed in.
virtual size_t getRecords (std::vector< Record > *records) const
 Convenience method to get all records.
virtual std::string doFormKey (const selections_t &sel, size_t sel_index_begin, size_t sel_index_end) const
virtual bool hasProduct (const std::string &productDataType) const
 Returns true if the index has ever encountered this product.
virtual Record doGetMostCurrentRecord () const
virtual Record doGetMostCurrentRecord (const code::Time &atTime, const selections_t &sel) const
virtual void doGetMostCurrentRecords (const code::Time &atTime, const std::set< selections_t > &criteria, std::map< selections_t, Record > &setme) const
virtual size_t getNextSelection (const selections_t &sel, selections_t *setme_next) const
virtual size_t getNextSelection (const selections_t &selection, selections_t *next_selection) const =0
 Get a list of posssibilities for the next selection.
virtual Record getNextRecord (const Record &fromRecord, const Direction &dir) const
virtual Record getNextRecord (const Record &fromRecord, const Direction &dir) const =0
 Navigate starting at a particular record.
virtual TimeInterval getHistoricalRange () const
 Returns the current historical range of this index.
virtual void getProductNames (std::vector< std::string > *inhere) const
 Returns the top-level product names encountered by this index.
virtual void getProductCategories (const std::string &productName, std::set< std::string > &setmeCategories) const
 Get the categories present for this top-level product name.
const std::string & getName () const
 Returns the source name if it has been set using setName().
void setName (const std::string &name)
 Set the name of this index.
std::string formKey (const selections_t &sel, size_t offset1=0, size_t offset2=~0) const
 Forms the key to which the given selection criteria would be mapped.
virtual size_t getHistoricalRecords (const Time &startTime, const Time &endTime, const selections_t &selection, std::vector< Record > *records) const
 Returns all the records which match the selection criteria (other than time) passed in.
size_t getHistoricalRecords (const Time &startTime, const Time &endTime, const Index::Record &matchThis, std::vector< Record > *records) const
 Returns all the records which match the selection criteria of the record to match that is passed in.
virtual size_t getHistoricalRecords (const Time &startTime, const Time &endTime, const std::vector< Index::Record > &matchThis, std::vector< Record > *records) const
 Returns all the records which match the selection criteria of any of the records to match that are passed in.
size_t getHistoricalRecordsByDataType (const Time &startTime, const Time &endTime, const code::Index::Record &rec, std::vector< Record > *records) const
 The usual variation of getHistoricalRecords will match subtype also.
Record getMostCurrentRecord () const
 Return the Index's most current record.
Record getMostCurrentRecord (const Record &sel) const
 Return the Index's most current record matching the `sel' record's selection criteria.
Record getMostCurrentRecord (const selections_t &s) const
 Return the Index's most current record matching the selection criteria.
Record getMostCurrentRecord (const code::Time &atTime, const selections_t &sel) const
 Return the most current record (before atTime) matching the criteria.
void getMostCurrentRecords (const code::Time &atTime, const std::set< selections_t > &criteria, std::map< selections_t, Record > &setme) const
 A batch form of getMostCurrentRecord().
const TimeIntervalgetMaximumHistory () const
 returns the maximum history maintained by this index.
bool fetchVirtualVolume (const code::Index::Record &in, VolumeRecords &out, Time *newVolumeStartTime=0) const
 Fetch the (latest) virtual volume of records.
bool fetchTraditionalVolume (const code::Index::Record &in, VolumeRecords &out) const
 Fetch a volume of records that contains this record.
void setMaximumHistory (const TimeInterval &newTI)
 Changes the maximum history maintained by this index.
bool hasHistoryLongerThan (const TimeInterval &newTI) const
 Does this index have a history longer than the time interval passed in? A time interval less than or equal to zero indicates that the index doesn't do any pruning and is therefore treated as being infinite.
const URLgetURL () const
 This will be set by IndexFactory if the Index is created using IndexFactory::createIndex.
void setURL (const URL &u)
 Pass in complete URL, i.e.
void copyListenersFrom (const ActionSource &other)
 copy all the listeners from the other source (replacing our own)
size_t getNumListeners () const
 returns the number of listeners linked to this source.
std::string getDir ()
 Returns a source-specific disk directory.
void addActionListener (SmartPtr< ActionListener > lstnr)
 Subscribe lstnr such that it receives all events from this ActionSource.
void addActionListener (const std::string &event_type, SmartPtr< ActionListener > lstnr)
 Subscribe lstnr such that it receives only this event type from this ActionSource.
void removeActionListener (SmartPtr< ActionListener > lstner)
 Unsubscribe lstnr such that it no longer receives events from this ActionSource.
void removeActionListener (const std::string &eventType, SmartPtr< ActionListener > lstner)
 Unsubscribe the listener so that it does not respond to the the event type noted.
void fireActionPerformed (const ActionEvent &e)
 Convenience function for subclasses to notify ActionListeners of events.
void fireActionPerformed (const ActionEvent *e)
 Convenience function for subclasses to notify ActionListeners of events.
void fireActionPerformed (const std::string &type)
 Convenience function for subclasses to notify ActionListeners of events.

Static Public Member Functions

static void introduceSelf ()
static bool isBracketedBy (const code::Index::Record &test, const code::Index::Record &first, const code::Index::Record &second)
 is the test record in between the other two records based on subtype? first > second
static bool isKnownDataSource (const std::string &dataSource)
 Checks the list of data sources and the list of Builders available.
static void addKnownDataSource (const std::string &dataSource)
 Add a data source to be "known".

Protected Member Functions

virtual std::string doFormKey (const selections_t &sel, size_t sel_index_begin, size_t sel_index_end) const =0
 Subclasses must implement this to build a key string from.
virtual Record doGetMostCurrentRecord (const Time &atTime, const selections_t &sel) const =0
virtual void doGetMostCurrentRecords (const Time &atTime, const std::set< selections_t > &criteria, std::map< selections_t, Index::Record > &setme) const =0
virtual void doAddRecord (const Record &item)
virtual void doAddRecord (const Index::Record &item)
 called by addRecord on a valid record before it is broadcast to listeners.
virtual size_t doGetHistoricalRecords (const Time &startTime, const Time &endTime, const std::set< std::string > &searchKeys, std::vector< Record > *records) const
virtual size_t doGetHistoricalRecords (const Time &startTime, const Time &endTime, const std::set< std::string > &searchKeys, std::vector< Record > *setme) const =0
 A work-horse called by all the getHistoricalRecords() methods.
virtual void doAgeOff (const Time &cutoff)
 The InMemoryIndex normally maintains information about all the records seen.
size_t getHistoricalRecords (const Time &startTime, const Time &endTime, const std::string &searchKey, std::vector< Record > *records) const
 A work-horse called by many of the getHistoricalRecords() methods.
size_t getHistoricalRecords (const Time &startTime, const Time &endTime, const std::set< std::string > &searchKeys, std::vector< Record > *records) const
 A work-horse called by all the getHistoricalRecords() methods.
void addRecord (const Index::Record &item)
 Given the record, adds it to all the internal maps.
void doEndDatasetNotification ()
 Notify interested parties that this data set is complete and that no new Records will come from this data set.
void setAsSourceOf (Index::Record &rec) const
 sets the source index of the passed in record to be ourself.
void sleepRequiredTime (const Time &newRecordTime) const
 Sleep as many seconds as required.
void doNotifications (const Index::Record &item)
 Look at this record and do the notifications.
virtual void notifyNewRecordEvent (const Index::Record &item)
 Look at this record and do the notification.
virtual void notifyNewTimeStampEvent (const Index::Record &item)
 Look at this record and do the notification.
void ageOff (const TimeInterval &cutoff)
 Prune off records older than cutoff (as measured from the most current record in the index).
void ageOff (const Time &cutoff)
 the Index normally maintains information about all the records seen.

Protected Attributes

double simulationRatio
TimeInterval ageoffInterval
URL url

Static Protected Attributes

static const std::string selectionSeparator
 The separation string.

Friends

class Index::Record


Member Typedef Documentation

typedef std::vector<std::string> code::Index::selections_t [inherited]

typedef std::vector< Index::Record > code::Index::VolumeRecords [inherited]


Member Enumeration Documentation

enum code::Index::Direction [inherited]

The directions in which you can navigate starting from a valid Index::Record.

See also:
Index::getNextRecord
Author:
Lakshman
Version:
Id
code_Index.h,v 1.53 2011/09/23 16:37:32 Valliappa.Lakshmanan Exp
Enumerator:
NextTime  Step toward the next available time.
PreviousTime  Step toward the previously available time.
NextSubType  Step up to the next subtype.

For example, radar data is often arranged by elevations. The next subtype would give you the next higher elevation with the same data type. So, navigation from a reflectivity record with an elevation of 1.5 degrees might give you a reflectivty record with an elevation of 2.5 degrees.

PreviousSubType  Step up to the previous subtype.

For example, radar data is often arranged by elevations. The previous subtype would give you the next lower elevation with the same data type. So, navigation from a reflectivity record with an elevation of 1.5 degrees might give you a reflectivty record with an elevation of 0.5 degrees.


Constructor & Destructor Documentation

code::WebIndex::WebIndex ( const URL website,
const IndexBase baseClass = IndexBase() 
)

The URL here needs to be something like: http://venus.protect.nssl:8080/?source=KABR We'll add webIndex/WebIndexServlet etc.

as required.

virtual code::WebIndex::~WebIndex (  )  [virtual]


Member Function Documentation

void code::ActionSource::addActionListener ( const std::string &  event_type,
SmartPtr< ActionListener lstnr 
) [inline, inherited]

Subscribe lstnr such that it receives only this event type from this ActionSource.

Parameters:
evt_type the event type we are subscribing to
lstnr the action listener to be subscribed.

void code::ActionSource::addActionListener ( SmartPtr< ActionListener lstnr  )  [inline, inherited]

Subscribe lstnr such that it receives all events from this ActionSource.

Parameters:
l the action listener to be subscribed.

static void code::Index::addKnownDataSource ( const std::string &  dataSource  )  [static, inherited]

Add a data source to be "known".

Then, these records will be shown in the Index.

See also:
isKnownDataSource You don't have to add data sources for which Builders have been introduced.

void code::Index::addRecord ( const Index::Record item  )  [protected, inherited]

Given the record, adds it to all the internal maps.

It is the responsibility of the subclass to somehow construct the record and to call this method.

void code::Index::ageOff ( const Time cutoff  )  [protected, inherited]

the Index normally maintains information about all the records seen.

It is possible to prune off records older than cutoff.

       ageOff( Time::getCurrentTime() - TimeInterval::Hours(1.0) )
       
will prune the index to keep records that are less than 1 hr old.
See also:
ageOff( const TimeInterval& ) since that method will work for archived indexes also.

void code::Index::ageOff ( const TimeInterval cutoff  )  [protected, inherited]

Prune off records older than cutoff (as measured from the most current record in the index).

       ageOff( TimeInterval::Hours(1.0) )
       
will prune the index to keep records within 1 hr of the most current record in the index. All other records will be aged off.

negative (and zero) cutoff intervals are ignored.

bool code::WebIndex::checkForNew (  ) 

void code::ActionSource::copyListenersFrom ( const ActionSource other  )  [inline, inherited]

copy all the listeners from the other source (replacing our own)

virtual void code::Index::doAddRecord ( const Index::Record item  )  [inline, protected, virtual, inherited]

called by addRecord on a valid record before it is broadcast to listeners.

Reimplemented in code::SQLIndex.

virtual void code::InMemoryIndex::doAddRecord ( const Record &  item  )  [protected, virtual, inherited]

virtual void code::InMemoryIndex::doAgeOff ( const Time cutoff  )  [protected, virtual, inherited]

The InMemoryIndex normally maintains information about all the records seen.

It is possible to prune off records older than cutoff.

 ageOff( Time::getCurrentTime() - TimeInterval::Hours(1.0) )
 
will prune the index to keep records that are less than 1 hr old.
See also:
ageOff( const TimeInterval& ) since that method will work for archived indexes also.

Implements code::Index.

void code::Index::doEndDatasetNotification (  )  [protected, inherited]

Notify interested parties that this data set is complete and that no new Records will come from this data set.

This method is optional -- after all, in a real-time index, there is no endDataSet is there? -- so you don't need to call it.

virtual std::string code::Index::doFormKey ( const selections_t sel,
size_t  sel_index_begin,
size_t  sel_index_end 
) const [protected, pure virtual, inherited]

Subclasses must implement this to build a key string from.

Returns:
the string to be assigned the new key value.
Parameters:
sel selections to use when building the key
begin the first index of sel to used. in [0...end]
end the first index, after `begin', to not use. in [begin...sel.size()]

Implemented in code::SQLIndex.

virtual std::string code::InMemoryIndex::doFormKey ( const selections_t sel,
size_t  sel_index_begin,
size_t  sel_index_end 
) const [virtual, inherited]

virtual size_t code::Index::doGetHistoricalRecords ( const Time startTime,
const Time endTime,
const std::set< std::string > &  searchKeys,
std::vector< Record > *  setme 
) const [protected, pure virtual, inherited]

A work-horse called by all the getHistoricalRecords() methods.

Has same behavior, except that it uses an implementation-specific search key obtained from the public interface elements.

virtual size_t code::InMemoryIndex::doGetHistoricalRecords ( const Time startTime,
const Time endTime,
const std::set< std::string > &  searchKeys,
std::vector< Record > *  records 
) const [protected, virtual, inherited]

virtual Record code::Index::doGetMostCurrentRecord ( const Time atTime,
const selections_t sel 
) const [protected, pure virtual, inherited]

Implemented in code::SQLIndex.

virtual Record code::InMemoryIndex::doGetMostCurrentRecord ( const code::Time atTime,
const selections_t sel 
) const [virtual, inherited]

virtual Record code::InMemoryIndex::doGetMostCurrentRecord (  )  const [virtual, inherited]

Implements code::Index.

virtual void code::Index::doGetMostCurrentRecords ( const Time atTime,
const std::set< selections_t > &  criteria,
std::map< selections_t, Index::Record > &  setme 
) const [protected, pure virtual, inherited]

virtual void code::InMemoryIndex::doGetMostCurrentRecords ( const code::Time atTime,
const std::set< selections_t > &  criteria,
std::map< selections_t, Record > &  setme 
) const [virtual, inherited]

void code::Index::doNotifications ( const Index::Record item  )  [protected, inherited]

Look at this record and do the notifications.

If your data source is different, and so the "normal" assumptions don't hold, then one or more of the notifyXXXEvent methods needs to be over-ridden.

bool code::Index::fetchTraditionalVolume ( const code::Index::Record in,
VolumeRecords out 
) const [inherited]

Fetch a volume of records that contains this record.

Returns:
true if at least one valid entry is found.

bool code::Index::fetchVirtualVolume ( const code::Index::Record in,
VolumeRecords out,
Time newVolumeStartTime = 0 
) const [inherited]

Fetch the (latest) virtual volume of records.

Note that this volume won't contain the in-record if the in-record is not the latest of its type. The time of the new volume is also returned, if non-zero is passed in. Records before this cutoff time belong to an already complete volume. Records >= cutoff belong to the newly forming volume.

Returns:
true if at least one valid entry is found.

void code::ActionSource::fireActionPerformed ( const std::string &  type  )  [inline, inherited]

Convenience function for subclasses to notify ActionListeners of events.

Parameters:
type the type of the ActionEvent to be passed along to the action listeners.

void code::ActionSource::fireActionPerformed ( const ActionEvent e  )  [inline, inherited]

Convenience function for subclasses to notify ActionListeners of events.

Parameters:
actionEvent the event to be passed along to the action listeners.

void code::ActionSource::fireActionPerformed ( const ActionEvent e  )  [inline, inherited]

Convenience function for subclasses to notify ActionListeners of events.

Parameters:
actionEvent the event to be passed along to the action listeners.

std::string code::Index::formKey ( const selections_t sel,
size_t  offset1 = 0,
size_t  offset2 = ~0 
) const [inherited]

Forms the key to which the given selection criteria would be mapped.

Uses only the criteria in the range [offset1,offset2) (the second not inclusive).

Parameters:
selection the selection criteria
offset [optional] which criteria to use. By default, start at zero (use all).

std::string code::ActionSource::getDir (  )  [inline, inherited]

Returns a source-specific disk directory.

Default implementation does nothing --- this should be overridden.

Returns:
a source-specific type identifier to indicate what action occurred.

virtual TimeInterval code::InMemoryIndex::getHistoricalRange (  )  const [virtual, inherited]

Returns the current historical range of this index.

Implements code::Index.

size_t code::Index::getHistoricalRecords ( const Time startTime,
const Time endTime,
const std::set< std::string > &  searchKeys,
std::vector< Record > *  records 
) const [inline, protected, inherited]

A work-horse called by all the getHistoricalRecords() methods.

Has same behavior, except that it uses an implementation-specific search key obtained from the public interface elements.

size_t code::Index::getHistoricalRecords ( const Time startTime,
const Time endTime,
const std::string &  searchKey,
std::vector< Record > *  records 
) const [protected, inherited]

A work-horse called by many of the getHistoricalRecords() methods.

Has same behavior, except that it uses an implementation-specific search key obtained from the public interface elements.

virtual size_t code::Index::getHistoricalRecords ( const Time startTime,
const Time endTime,
const std::vector< Index::Record > &  matchThis,
std::vector< Record > *  records 
) const [virtual, inherited]

Returns all the records which match the selection criteria of any of the records to match that are passed in.

The times of the records passed in are ignored.

For example, to get all the Reflectivity, Velocity and Scit records within the past half-hour, you would do this:

       std::vector< Index::Record > recordsToMatch;
       recordsToMatch.push_back(  Index::getRecord(...)  ); // reflectivity
       recordsToMatch.push_back(  Index::getRecord(...)  ); // velocity
       recordsToMatch.push_back(  Index::getRecord(...)  ); // scit cells

       Time endTime = Time::CurrentTime();
       TimeInterval window( TimeInterval::Minutes(30) );
       Time startTime   = endTime - window;

       std::vector< Index::Record > records;

       if ( myindex.getHistoricalRecords( startTime, endTime, recordsToMatch, &records) ){
Here, records will contain the records that have the
same data type as that of the records to be matched.
       }
       
Returns:
number of records found.
Parameters:
startTime start of search interval (inclusive)
endTime end of search interval (inclusive)
matchThis The records whose data types are to be matched.
records Vector of records to fill in.
This method is not as efficient as knowing the actual time of the product. However, it is the most efficient of the getHistoricalRecords() family of methods.

size_t code::Index::getHistoricalRecords ( const Time startTime,
const Time endTime,
const Index::Record matchThis,
std::vector< Record > *  records 
) const [inherited]

Returns all the records which match the selection criteria of the record to match that is passed in.

The time of the record passed in is ignored.

For example, to get all the records within the past half-hour that match this record, you would do this:

       Index::Record recordToMatch = ...
       Time endTime = Time::CurrentTime();
       TimeInterval window( TimeInterval::Minutes(30) );
       Time startTime   = endTime - window;

       std::vector< Index::Record > records;

       if ( myindex.getHistoricalRecords( startTime, endTime, recordToMatch, &records) ){
Here, records will contain the records that have the
same data type as that of the record to be matched.
       }
       
Returns:
number of records found.
Parameters:
startTime start of search interval (inclusive)
endTime end of search interval (inclusive)
matchThis The record whose data type is to be matched.
records Vector of records to fill in.
This method is not as efficient as knowing the actual time of the product.

virtual size_t code::Index::getHistoricalRecords ( const Time startTime,
const Time endTime,
const selections_t selection,
std::vector< Record > *  records 
) const [virtual, inherited]

Returns all the records which match the selection criteria (other than time) passed in.

For example, to get all the 0.5 Reflectivity scans within the past half-hour, you would do this:

       Time endTime = Time::CurrentTime();
       TimeInterval window( TimeInterval::Minutes(60) );
       Time startTime   = endTime - window;

       std::vector< Index::Record > records;
       Index::selections_t selection;
Note: no time in the selection criteria!
       selection.push_back( TypeName::Reflectivity );
       selection.push_back( "0.5" );
       if ( myindex.getHistoricalRecords( startTime, endTime, selection, &records) ){
Here, records will contain the records for the 0.5 degree
reflectivity scans within the past one hour
       }
       
Returns:
number of records found.
Parameters:
startTime start of search interval (inclusive)
endTime end of search interval (inclusive)
selection Criteria to match (do not include time!)
records Vector of records to fill in.
This method is not as efficient as knowing the actual time of the product.

size_t code::Index::getHistoricalRecordsByDataType ( const Time startTime,
const Time endTime,
const code::Index::Record rec,
std::vector< Record > *  records 
) const [inherited]

The usual variation of getHistoricalRecords will match subtype also.

Using this version allows you to match all subtypes.

const TimeInterval& code::Index::getMaximumHistory (  )  const [inline, inherited]

returns the maximum history maintained by this index.

A time interval less than or equal to zero indicates that the index doesn't do any pruning.

Record code::Index::getMostCurrentRecord ( const code::Time atTime,
const selections_t sel 
) const [inline, inherited]

Return the most current record (before atTime) matching the criteria.

Parameters:
atTime Records occuring after this time are ignored.
selection Criteria to match. the first string (time) is ignored.
Returns:
the most current matching record, or an invalid one if no match.

Record code::Index::getMostCurrentRecord ( const selections_t s  )  const [inline, inherited]

Return the Index's most current record matching the selection criteria.

Parameters:
selection Criteria to match. the first string (time) is ignored.
Returns:
the most current matching record, or an invalid one if no match.

Record code::Index::getMostCurrentRecord ( const Record sel  )  const [inline, inherited]

Return the Index's most current record matching the `sel' record's selection criteria.

Record code::Index::getMostCurrentRecord (  )  const [inline, inherited]

Return the Index's most current record.

void code::Index::getMostCurrentRecords ( const code::Time atTime,
const std::set< selections_t > &  criteria,
std::map< selections_t, Record > &  setme 
) const [inline, inherited]

A batch form of getMostCurrentRecord().

This is much faster than calling getMostCurrentRecord() multiple times.

Parameters:
atTime Records occuring after this time are ignored.
selection A set of criteria to match. The first string (time) of each is ignored.
setme A map criteria and Records that matched the input criteria.

const std::string& code::Index::getName (  )  const [inline, inherited]

Returns the source name if it has been set using setName().

virtual Record code::Index::getNextRecord ( const Record fromRecord,
const Direction dir 
) const [pure virtual, inherited]

Navigate starting at a particular record.

Parameters:
fromRecord the record to navigate from
dir the direction to navigate toward. Use one of the InMemoryIndex navigation directions.
Returns:
the next record in that direction, or an invalid record if no further record exists in that direction.

Implemented in code::SQLIndex.

virtual Record code::InMemoryIndex::getNextRecord ( const Record &  fromRecord,
const Direction dir 
) const [virtual, inherited]

virtual size_t code::Index::getNextSelection ( const selections_t selection,
selections_t next_selection 
) const [pure virtual, inherited]

Get a list of posssibilities for the next selection.

Parameters:
selection Your selection criteria. May be empty.
next_selection possible selections for the next criterion, set by this method.
Returns:
the number of possibilities. If zero is returned, then either it is the end of the road and you can use getRecord to get the record that matches or there are no records that match your selection criteria.

Implemented in code::SQLIndex.

virtual size_t code::InMemoryIndex::getNextSelection ( const selections_t sel,
selections_t setme_next 
) const [virtual, inherited]

size_t code::ActionSource::getNumListeners (  )  const [inline, inherited]

returns the number of listeners linked to this source.

virtual void code::InMemoryIndex::getProductCategories ( const std::string &  productName,
std::set< std::string > &  setmeCategories 
) const [virtual, inherited]

Get the categories present for this top-level product name.

For example, returns 0.5, 1.5, etc. if Reflectivity is passed in.

The returned set has an empty string if there exists a product with no sub-category.

Due to age-offs, some of the listed products may not exist.

Implements code::Index.

virtual void code::InMemoryIndex::getProductNames ( std::vector< std::string > *  inhere  )  const [virtual, inherited]

Returns the top-level product names encountered by this index.

Due to age-offs, some of the listed products may not exist.

Implements code::Index.

virtual Record code::Index::getRecord ( const selections_t selection  )  const [pure virtual, inherited]

Get the record matching the selection criteria.

Returns:
matching record, or an invalid one if no matches.
Parameters:
selection your selection criteria.

Implemented in code::SQLIndex.

virtual Record code::InMemoryIndex::getRecord ( const selections_t sel  )  const [virtual, inherited]

virtual size_t code::Index::getRecords ( std::vector< Record > *  records  )  const [virtual, inherited]

Convenience method to get all records.

size_t code::Index::getRecords ( const selections_t selection,
std::vector< Record > *  records,
std::vector< std::string > *  next_selection = 0 
) const [inherited]

Obtain all the records that match the selections passed in.

Example:

       std::vector< Index::Record > records;
       std::vector< std::string > selection, next_selection;
       selection.push_back( "16:05:23 (12)" );
       selection.push_back( TypeName::Reflectivity );
       if ( myindex.getHistoricalRecords(selection, &records, &next_selection) ){
Here, records will contain the records for
all the reflectivity elevation scans at the time passed in.
next_selection will contain strings "0.5", "1.5", etc.
       }
       
Returns:
number of records found.
Parameters:
selection Your selection criteria (may be empty).
records Records that match the selection criteria, filled in by this method. Rfl vol 23 elev 0.5 is matched by any of the following selection criteria:
  1. (empty)
  2. Rfl
  3. Rfl, 23
  4. Rfl, 23, 0.5
next_selection Possible selections for the next criterion, filled in by this method. Maybe zero, if you don't need it.
See also:
getNextSelection
This method is implemented using the getRecord and getNextSelection methods.

virtual size_t code::InMemoryIndex::getRecords ( std::vector< Record > *  records  )  const [virtual, inherited]

const URL& code::IndexBase::getURL (  )  const [inline, inherited]

This will be set by IndexFactory if the Index is created using IndexFactory::createIndex.

If you construct the Index directly, the URL will be unavailable unless you explicitly call setURL()

Returns:
Complete URL, e.g: "rssd://karnak/data/realtime/radar/multi/code_index.lb&protocol=xmllb"

bool code::Index::hasHistoryLongerThan ( const TimeInterval newTI  )  const [inherited]

Does this index have a history longer than the time interval passed in? A time interval less than or equal to zero indicates that the index doesn't do any pruning and is therefore treated as being infinite.

virtual bool code::InMemoryIndex::hasProduct ( const std::string &  productDataType  )  const [virtual, inherited]

Returns true if the index has ever encountered this product.

Due to age=offs, the product may actually not exist.

Implements code::Index.

static void code::WebIndex::introduceSelf (  )  [static]

static bool code::Index::isBracketedBy ( const code::Index::Record test,
const code::Index::Record first,
const code::Index::Record second 
) [static, inherited]

is the test record in between the other two records based on subtype? first > second

static bool code::Index::isKnownDataSource ( const std::string &  dataSource  )  [static, inherited]

Checks the list of data sources and the list of Builders available.

bool code::WebIndex::isValid (  )  const [inline]

virtual void code::Index::notifyNewRecordEvent ( const Index::Record item  )  [protected, virtual, inherited]

Look at this record and do the notification.

If your data source is different, and so the "normal" assumptions don't hold, this notifyXXXEvent method needs to be over-ridden.

virtual void code::Index::notifyNewTimeStampEvent ( const Index::Record item  )  [protected, virtual, inherited]

Look at this record and do the notification.

If your data source is different, and so the "normal" assumptions don't hold, this notifyXXXEvent method needs to be over-ridden.

void code::ActionSource::removeActionListener ( const std::string &  eventType,
SmartPtr< ActionListener lstner 
) [inline, inherited]

Unsubscribe the listener so that it does not respond to the the event type noted.

This works only if the listener was added via addActionListener( type, SmartPtr )

Parameters:
type The event type
lstnr The listener to remove

void code::ActionSource::removeActionListener ( SmartPtr< ActionListener lstner  )  [inline, inherited]

Unsubscribe lstnr such that it no longer receives events from this ActionSource.

Parameters:
lstnr the action listener to be unsubscribed.

void code::Index::setAsSourceOf ( Index::Record rec  )  const [protected, inherited]

sets the source index of the passed in record to be ourself.

void code::Index::setMaximumHistory ( const TimeInterval newTI  )  [inherited]

Changes the maximum history maintained by this index.

If the new interval is less than what we originally had, the extra records are pruned. If the new interval is greater than what we originally had, we will slowly grow to that index. To obtain the missed records, this Index object has to be recreated. A time interval less than or equal to zero indicates that the index shouldn't do any pruning.

void code::Index::setName ( const std::string &  name  )  [inline, inherited]

Set the name of this index.

This is useful because then for every record you get out of this index, you can do:

     rec.getSourceIndex()->getName()
     

void code::IndexBase::setURL ( const URL u  )  [inline, inherited]

Pass in complete URL, i.e.

"rssd://karnak/data/realtiem/radar/multi/code_index.lb&protocol=xmllb" This is called by IndexFactory::createIndex

void code::Index::sleepRequiredTime ( const Time newRecordTime  )  const [protected, inherited]

Sleep as many seconds as required.

This method is called before the notifications start.


Friends And Related Function Documentation

friend class Index::Record [friend, inherited]


Member Data Documentation

TimeInterval code::IndexBase::ageoffInterval [protected, inherited]

const std::string code::InMemoryIndex::selectionSeparator [static, protected, inherited]

The separation string.

Assumes the selection criteria have no spaces.

double code::IndexBase::simulationRatio [protected, inherited]

URL code::IndexBase::url [protected, inherited]


Generated on Fri May 4 13:40:13 2012 for WDSS-IIw2 by  doxygen 1.4.7