DataCollector Module
API Reference
The base components define foundational functionality of the DataCollector
class for maintaining continuity.
Base Components
DataCollector.h
-
class DataCollector
- #include <DataCollector.h>
The
DataCollector
class is an abstract class that defines the interface for collecting data in the Triangle Model. Created by bernardoct on 8/25/17.Subclassed by AllocatedIntakeDataCollector, EmptyDataCollector, IntakeDataCollector, JointWTPDataCollector, ReservoirDataCollector, RestrictionsDataCollector, TransfersDataCollector, UtilitiesDataCollector, WaterReuseDataCollector
Public Functions
-
explicit DataCollector(int id, const char *name, unsigned long realization, int type, int table_width)
Constructor for the DataCollector class. This function initializes a DataCollector object with the specified attributes.
This constructor is marked as explicit to avoid implicit conversions from integer to DataCollector.
- Parameters:
id – The unique identifier for the DataCollector object.
name – The name of the DataCollector object as a constant character pointer.
realization – The realization number associated with the DataCollector.
type – The type of the DataCollector object.
table_width – The width of the data table.
-
virtual ~DataCollector()
Destructor for the DataCollector class.
This function cleans up resources used by the DataCollector object.
-
virtual string printTabularString(int week) = 0
Prints the data collected by the DataCollector object in a tabular format.
This function does not have an implementation in the DataCollector class and must be implemented by derived classes.
- Parameters:
week – The week number to print the data for.
- Returns:
A string containing the data collected by the DataCollector object in a tabular format.
-
virtual string printCompactString(int week) = 0
Prints the data collected by the DataCollector object in a compact format.
This function does not have an implementation in the DataCollector class and must be implemented by derived classes.
- Parameters:
week – The week number to print the data for.
- Returns:
A string containing the data collected by the DataCollector object in a compact format.
-
virtual string printTabularStringHeaderLine1() = 0
Prints the header for the tabular data collected by the DataCollector object.
This function does not have an implementation in the DataCollector class and must be implemented by derived classes.
- Returns:
A string containing the header for the tabular data collected by the DataCollector object.
-
virtual string printTabularStringHeaderLine2() = 0
Prints the second line of the header for the tabular data collected by the DataCollector object.
This function does not have an implementation in the DataCollector class and must be implemented by derived classes.
- Returns:
A string containing the second line of the header for the tabular data collected by the DataCollector object.
-
virtual string printCompactStringHeader() = 0
Prints the header for the compact data collected by the DataCollector object.
This function does not have an implementation in the DataCollector class and must be implemented by derived classes.
- Returns:
A string containing the header for the compact data collected by the DataCollector object.
-
virtual void collect_data() = 0
Collects the data for the DataCollector object.
This function does not have an implementation in the DataCollector class and must be implemented by derived classes.
- Returns:
void
Public Members
-
const int id
The unique ID of the data collector.
-
const int type
The type of data collector.
-
const int table_width
The width of the table to print the data.
-
const char *name
The name of the data collector.
-
unsigned long realization
The realization number associated with the data collector.
-
explicit DataCollector(int id, const char *name, unsigned long realization, int type, int table_width)