Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91918486
blackdynamite.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 15, 17:43
Size
3 KB
Mime Type
text/x-c
Expires
Sun, Nov 17, 17:43 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22347138
Attached To
R3127 blackdynamite
blackdynamite.hh
View Options
/*
author : Nicolas RICHART <nicolas.richart@epfl.ch>
author : Guillaume ANCIAUX (anciaux@labri.fr, g.anciaux@laposte.net)
author : Till JUNGE <till.junge@epfl.ch>
*/
/* -------------------------------------------------------------------------- */
#ifndef __BLACKDYNAMITE_PUSHER_HH__
#define __BLACKDYNAMITE_PUSHER_HH__
#include <string>
/* -------------------------------------------------------------------------- */
namespace
BlackDynamite
{
typedef
unsigned
int
UInt
;
typedef
double
Real
;
class
SQLConnectionManager
;
class
StateManager
;
class
QuantitiesManager
;
class
RunManager
{
/* ------------------------------------------------------------------------ */
/* Typedefs */
/* ------------------------------------------------------------------------ */
public
:
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public
:
RunManager
();
RunManager
(
const
std
::
string
&
dbname
,
const
std
::
string
&
user
,
const
std
::
string
&
host
,
const
std
::
string
&
schema
,
UInt
run_id
);
virtual
~
RunManager
();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
//! function to be called to update the state of the job at the begining of the run
void
startRun
();
//! function to be called to update the state of the job at the end of the run
void
endRun
();
//! change the state of a run
void
changeState
(
const
std
::
string
&
state
);
//! template method that pushes a value associated with a quantity at a particular timestep
template
<
typename
T
>
void
push
(
const
T
&
value
,
const
std
::
string
&
quantity
,
const
UInt
&
step
);
//! template method that pushes a string to a given run column
void
push
(
const
std
::
string
&
value
,
const
std
::
string
&
quantity
);
//! give the number of instance of blackdynamite
UInt
getInstanceCounter
();
protected
:
//! initialisation method
void
init
(
const
std
::
string
&
dbname
,
const
std
::
string
&
user
,
const
std
::
string
&
host
,
const
std
::
string
&
schema
,
UInt
run_id
);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected
:
UInt
run_id
;
std
::
string
sql_schema
;
SQLConnectionManager
*
sql_connection_manager
;
StateManager
*
state_manager
;
QuantitiesManager
*
quantities_manager
;
};
/* -------------------------------------------------------------------------- */
}
#endif
/* __BLACKDYNAMITE_PUSHER_HH__ */
Event Timeline
Log In to Comment