jdl-api-cpp-3.4.4
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
glite::jdl::CollectionAd Class Reference

Provides a representation of collection (bunch) of jobs. More...

#include <glite/jdl/collectionad.h>

Inheritance diagram for glite::jdl::CollectionAd:
glite::jdl::Ad

Public Member Functions

 CollectionAd (const classad::ClassAd &classAd)
 
 CollectionAd ()
 
 CollectionAd (const std::string &classAd)
 
void operator= (const CollectionAd &collect)
 
virtual ~CollectionAd () throw ()
 
CollectionAdcheck ()
 
std::string toSubmissionString ()
 
std::vector< std::string > getNodeStringValue (const std::string &node, const std::string &attr_name)
 
std::vector< std::pair
< std::string,std::vector
< std::string > > > 
getNodeStringValues (const std::string &attr_name)
 
std::map< std::string,
std::vector< std::string > > 
getNodeStringValuesMap (const std::string &attr_name)
 
void setLocalAccess (bool lookInto)
 
void setDefaultRank (classad::ExprTree *attr_value)
 
void setDefaultReq (classad::ExprTree *attr_value)
 
bool gettoBretrieved ()
 
ExtractedAdgetExtractedAd ()
 
void addNode (Ad node)
 
- Public Member Functions inherited from glite::jdl::Ad
 Ad ()
 
virtual ~Ad () throw ()
 
 Ad (const classad::ClassAd &classAd)
 
 Ad (const std::string &jdl_string)
 
 Ad (const Ad &jobad)
 
virtual void operator= (const Ad &jobad)
 
void fromString (const std::string &jdl_string, std::string jdl_file="")
 
void fromFile (const std::string &jdl_file)
 
void fromStream (std::istream &jdl_in)
 
virtual void fromClassAd (const classad::ClassAd &classAd)
 
virtual std::string toString ()
 
virtual std::string toString (const std::string &attr_name)
 
virtual std::string toLines ()
 
bool isSet ()
 
void clear ()
 
classad::ClassAd *const ad ()
 
bool hasAttribute (const std::string &attr_name)
 
virtual classad::ExprTree * delAttribute (const std::string &attr_name)
 
void remAttribute (const std::string &attr_name)
 
virtual classad::ExprTree * lookUp (const std::string &attr_name)
 
bool hasAttribute (const std::string &attr_name, const std::string &attr_value)
 
std::vector< std::string > attributes ()
 
void merge (Ad source, bool overwrite=true)
 
bool hasWarnings ()
 
std::vector< std::string > getWarnings ()
 
void addWarning (const std::string &msg)
 
int getType (const std::string &attr_name)
 
void addAttribute (const std::string &attr_name, int attr_value)
 
void addAttribute (const std::string &attr_name, double attr_value)
 
void addAttribute (const std::string &attr_name, bool attr_value)
 
void addAttribute (const std::string &attr_name, const std::string &attr_value)
 
void addAttribute (const std::string &attr_name, const char *attr_value)
 
void addAttribute (const std::string &attr_name, Ad *attr_value)
 
virtual void setAttributeExpr (const std::string &attr_name, const std::string &attr_value)
 
virtual void setAttribute (const std::string &attr_name, int attr_value)
 
virtual void setAttribute (const std::string &attr_name, const std::string &attr_value)
 
virtual void setAttribute (const std::string &attr_name, const char *attr_value)
 
virtual void setAttribute (const std::string &attr_name, double attr_value)
 
virtual void setAttribute (const std::string &attr_name, bool attr_value)
 
virtual void setAttribute (const std::string &attr_name, Ad *attr_value)
 
virtual void setAttributeExpr (const std::string &attr_name, classad::ExprTree *attr_value)
 
virtual std::string getAttributeExpr (const std::string &attr_name)
 
std::vector< int > getIntValue (const std::string &attr_name)
 
std::vector< double > getDoubleValue (const std::string &attr_name)
 
std::vector< bool > getBoolValue (const std::string &attr_name)
 
virtual std::vector< std::string > getStringValue (const std::string &attr_name)
 
std::vector< std::vector
< std::string > > 
getStringList (const std::string &attr_name)
 
virtual Ad getAd (const std::string &attr_name)
 
virtual std::string getString (const std::string &attr_name)
 
virtual int getInt (const std::string &attr_name)
 
virtual double getDouble (const std::string &attr_name)
 
virtual bool getBool (const std::string &attr_name)
 

Additional Inherited Members

- Public Types inherited from glite::jdl::Ad
enum  {
  TYPE_UNKNOWN = classad::Value::ERROR_VALUE, TYPE_INTEGER =classad::Value::INTEGER_VALUE, TYPE_BOOLEAN =classad::Value::BOOLEAN_VALUE, TYPE_STRING =classad::Value::STRING_VALUE,
  TYPE_REAL =classad::Value::REAL_VALUE, TYPE_CLASSAD =classad::Value::CLASSAD_VALUE, TYPE_EXPRESSION =classad::Value::UNDEFINED_VALUE
}
 
- Protected Member Functions inherited from glite::jdl::Ad
virtual void addAttribute (std::string attr_name, classad::Value val)
 
virtual void appendValue (classad::ExprTree *tree, const classad::Value &val, const std::string &attr_name)
 
virtual void insertAttribute (const std::string &attr_name, classad::ExprTree *val)
 
virtual void insertAttribute (const std::string &attr_name, classad::Value val)
 
virtual classad::Value getTypeValue (const std::string &attr_name)
 
bool hasAttribute (classad::ExprTree *tree, const std::string &attr_value)
 
- Protected Attributes inherited from glite::jdl::Ad
std::vector< std::string > warning_messages_v
 

Detailed Description

Provides a representation of collection (bunch) of jobs.

Version
0.1
Date
April 2005
Author
Alessandro Maraschini aless.nosp@m.andr.nosp@m.o.mar.nosp@m.asch.nosp@m.ini@d.nosp@m.atam.nosp@m.at.it

Constructor & Destructor Documentation

glite::jdl::CollectionAd::CollectionAd ( const classad::ClassAd &  classAd)

Constructory by Classad

glite::jdl::CollectionAd::CollectionAd ( )

Default constructor

glite::jdl::CollectionAd::CollectionAd ( const std::string &  classAd)

Constructory by Stirng

virtual glite::jdl::CollectionAd::~CollectionAd ( )
throw (
)
virtual

Default Destructor

Member Function Documentation

void glite::jdl::CollectionAd::addNode ( Ad  node)

Add a node to the collection

Parameters
nodethe node to be added
CollectionAd* glite::jdl::CollectionAd::check ( )
Check both syntax and semantic rules for a collection. Fill default values
Returns
the checked/filled collection instance
ExtractedAd* glite::jdl::CollectionAd::getExtractedAd ( )

Retrieve the local files to be for the current instance

Returns
a pointer to an ExtractedAd instance, containing all local files to be extracted
std::vector< std::string > glite::jdl::CollectionAd::getNodeStringValue ( const std::string &  node,
const std::string &  attr_name 
)

Retrieve (if present) the string value for the specified attribute

Parameters
nodethe name of the node to be looked for
attr_namethe name of the attributeto be retrieved
Returns
the value of the specified string attribute
std::vector< std::pair<std::string ,std::vector< std::string > > > glite::jdl::CollectionAd::getNodeStringValues ( const std::string &  attr_name)

Retrieve the string values for the specified attribute for all the nodes

Parameters
attr_namethe name of the attribute to be retrieved
Returns
a vector of pair, each pair containing respectively the name of the node and a vector of all the string values corresponding to the specified attr_name
std::map<std::string, std::vector< std::string > > glite::jdl::CollectionAd::getNodeStringValuesMap ( const std::string &  attr_name)

Retrieve the string values for the specified attribute for all the nodes

Parameters
attr_namethe name of the attribute to be retrieved
Returns
a map with the nodes name and the vector of all the string values corresponding to the specified attr_name
bool glite::jdl::CollectionAd::gettoBretrieved ( )
inline

Return wheter are there any files to be retrieved This value has significant meaning only after a previous check

void glite::jdl::CollectionAd::operator= ( const CollectionAd collect)

operator =

void glite::jdl::CollectionAd::setDefaultRank ( classad::ExprTree *  attr_value)

Set the default value for Rank attribute (take in consideration if not specified in JDL)

Parameters
attr_valuethe value to be set to the default rank
void glite::jdl::CollectionAd::setDefaultReq ( classad::ExprTree *  attr_value)

Set the default value for Requirements attribute (take in consideration if not specified in JDL)

Parameters
attr_valuethe value to be set to the default requirements
void glite::jdl::CollectionAd::setLocalAccess ( bool  lookInto)

If Collection is used by a remove machine, it is impossible to look into the local hard-disk by default this parameter is set to true

Parameters
lookIntoallow all the check methods to access to the local hard disk (true) or skip the check (false)
std::string glite::jdl::CollectionAd::toSubmissionString ( )

Performs a check and return the checked/filled collection result

Returns
the checked collection into its string representation

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