Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
PolymarkerTool Class Referenceabstract

The base class for the object that will actually run the Polymarker application. More...

#include <polymarker_tool.hpp>

Inheritance diagram for PolymarkerTool:
[legend]
Collaboration diagram for PolymarkerTool:
[legend]

Public Member Functions

 PolymarkerTool (PolymarkerServiceJob *job_p, const PolymarkerSequence *seq_p, const PolymarkerServiceData *data_p)
 
 PolymarkerTool (PolymarkerServiceJob *job_p, const PolymarkerSequence *seq_p, const PolymarkerServiceData *data_p, const json_t *root_p)
 
virtual ~PolymarkerTool ()
 The PolymarkerTool destructor. More...
 
const char * GetName ()
 Get the name of this PolymarkerTool. More...
 
virtual bool ParseParameters (const ParameterSet *const param_set_p)=0
 Parse a ParameterSet to set the variables that the PolymarkerTool's ServiceJob will run with. More...
 
virtual bool PreRun ()
 The function that will be called before trying to run this PolymarkerTool. More...
 
virtual OperationStatus Run ()=0
 
virtual bool PostRun ()=0
 The function that will be called after running this PolymarkerTool. More...
 
virtual OperationStatus GetStatus (bool update_flag)=0
 Get the OperationStatus for the ServiceJob that this PolymarkerTool is running. More...
 
virtual char * GetLog ()=0
 Get the log after the PolymarkerTool has finished running. More...
 
virtual char * GetResults (PolymarkerFormatter *formatter_p)=0
 Get the results from the run of this PolymarkerTool. More...
 
virtual bool AddToJSON (json_t *root_p)
 Add the required information for this PolymarkerTool to be serialised to JSON and deserialised again. More...
 
virtual PolymarkerToolType GetToolType () const =0
 Get the PolymarkerToolType for this PolymarkerTool. More...
 
bool AddSectionToResult (json_t *result_p, const char *const filename_s, const char *const key_s, PolymarkerFormatter *formatter_p)
 
void SetPolymarkerSequence (const PolymarkerSequence *seq_p)
 Set the PolymarkerSequence that this PolymarkerTool will run against. More...
 
bool SaveJobMetadata () const
 
bool SetJobMetadata ()
 
bool SetJobUUID (const uuid_t id)
 
void FreePolymarkerTool (PolymarkerTool *tool_p)
 Free a given PolymarkerTool. More...
 
OperationStatus RunPolymarkerTool (PolymarkerTool *tool_p)
 Run a given PolymarkerTool. More...
 

Protected Attributes

PolymarkerServiceJobpt_service_job_p
 The PolymarkerServiceJob that this PolymarkerTool will run. More...
 
const PolymarkerSequencept_seq_p
 The PolymarkerSequence that this PolymarkerTool's ServiceJob will be running against. More...
 
const PolymarkerServiceDatapt_service_data_p
 The PolymarkerServiceData for the PolymarkerService that will be running this PolymarkerTool. More...
 
char * pt_job_dir_s
 The local directory where the results and logging data will be stored. More...
 

Static Protected Attributes

static const char *const PT_JOB_DIR_S
 The key used for specifying the PolymarkerTool's job directory within and JSON-based serialisations of a PolymarkerTool. More...
 

Detailed Description

The base class for the object that will actually run the Polymarker application.

Constructor & Destructor Documentation

◆ PolymarkerTool() [1/2]

PolymarkerTool ( PolymarkerServiceJob job_p,
const PolymarkerSequence seq_p,
const PolymarkerServiceData data_p 
)

◆ PolymarkerTool() [2/2]

PolymarkerTool ( PolymarkerServiceJob job_p,
const PolymarkerSequence seq_p,
const PolymarkerServiceData data_p,
const json_t *  root_p 
)

◆ ~PolymarkerTool()

virtual ~PolymarkerTool ( )
virtual

The PolymarkerTool destructor.

Member Function Documentation

◆ GetName()

const char* GetName ( )

Get the name of this PolymarkerTool.

Returns
the name

◆ ParseParameters()

virtual bool ParseParameters ( const ParameterSet *const  param_set_p)
pure virtual

Parse a ParameterSet to set the variables that the PolymarkerTool's ServiceJob will run with.

Parameters
param_set_pThe ParameterSet that the variables will be set from.
Returns
true if the required variables were collected successfully, false otherwise

Implemented in AsyncSystemPolymarkerTool.

◆ PreRun()

virtual bool PreRun ( )
virtual

The function that will be called before trying to run this PolymarkerTool.

Returns
true if the call was successful, false otherwise

Reimplemented in AsyncSystemPolymarkerTool.

◆ Run()

virtual OperationStatus Run ( )
pure virtual

Implemented in AsyncSystemPolymarkerTool.

◆ PostRun()

virtual bool PostRun ( )
pure virtual

The function that will be called after running this PolymarkerTool.

Returns
true if the call was successful, false otherwise

Implemented in AsyncSystemPolymarkerTool.

◆ GetStatus()

virtual OperationStatus GetStatus ( bool  update_flag)
pure virtual

Get the OperationStatus for the ServiceJob that this PolymarkerTool is running.

Parameters
update_flagIf this is true, then the ServiceJob will be checked for its latest status. If this is false, then the last cached value will be used.
Returns
The OperationStatus for this PolymarkerTool's ServiceJob.

Implemented in AsyncSystemPolymarkerTool.

◆ GetLog()

virtual char* GetLog ( )
pure virtual

Get the log after the PolymarkerTool has finished running.

Returns
The logging messages as a c-style string or 0 upon error.

Implemented in AsyncSystemPolymarkerTool.

◆ GetResults()

virtual char* GetResults ( PolymarkerFormatter formatter_p)
pure virtual

Get the results from the run of this PolymarkerTool.

Parameters
formatter_pThe PolymarkerFormatter used to
Returns
The results as a c-style string or 0 upon error.

Implemented in AsyncSystemPolymarkerTool.

◆ AddToJSON()

virtual bool AddToJSON ( json_t *  root_p)
virtual

Add the required information for this PolymarkerTool to be serialised to JSON and deserialised again.

This is called by each child class of PolymarkerTool all the way down to the actual PolymarkerTool child object that is being used.

Parameters
root_pThe JSON fragment that the required details will be added to
Returns
true if the information was added successfully, false otherwise

Reimplemented in AsyncSystemPolymarkerTool.

◆ GetToolType()

virtual PolymarkerToolType GetToolType ( ) const
pure virtual

Get the PolymarkerToolType for this PolymarkerTool.

Returns
The PolymarkerToolType.

Implemented in AsyncSystemPolymarkerTool.

◆ AddSectionToResult()

bool AddSectionToResult ( json_t *  result_p,
const char *const  filename_s,
const char *const  key_s,
PolymarkerFormatter formatter_p 
)

◆ SetPolymarkerSequence()

void SetPolymarkerSequence ( const PolymarkerSequence seq_p)

Set the PolymarkerSequence that this PolymarkerTool will run against.

Parameters
seq_pThe PolymarkerSequence to use.

◆ SaveJobMetadata()

bool SaveJobMetadata ( ) const

◆ SetJobMetadata()

bool SetJobMetadata ( )

◆ SetJobUUID()

bool SetJobUUID ( const uuid_t  id)

◆ FreePolymarkerTool()

void FreePolymarkerTool ( PolymarkerTool tool_p)

Free a given PolymarkerTool.

This is simply a C-wrapper function around the PolymarkerTool destructor.

Parameters
tool_pThe PolymarkerTool to free

◆ RunPolymarkerTool()

OperationStatus RunPolymarkerTool ( PolymarkerTool tool_p)

Run a given PolymarkerTool.

This is simply a C-wrapper function around the PolymarkerTool::run() function.

Parameters
tool_pThe PolymarkerTool to run.
Returns
The OperationStatus of the PolymarkerTool.

Field Documentation

◆ pt_service_job_p

PolymarkerServiceJob* pt_service_job_p
protected

The PolymarkerServiceJob that this PolymarkerTool will run.

◆ pt_seq_p

const PolymarkerSequence* pt_seq_p
protected

The PolymarkerSequence that this PolymarkerTool's ServiceJob will be running against.

◆ pt_service_data_p

const PolymarkerServiceData* pt_service_data_p
protected

The PolymarkerServiceData for the PolymarkerService that will be running this PolymarkerTool.

◆ pt_job_dir_s

char* pt_job_dir_s
protected

The local directory where the results and logging data will be stored.

◆ PT_JOB_DIR_S

const char* const PT_JOB_DIR_S
staticprotected

The key used for specifying the PolymarkerTool's job directory within and JSON-based serialisations of a PolymarkerTool.


The documentation for this class was generated from the following file: