Swarm-NG
1.1
|
This namespace contains routines for opening and querying a swarm log file. More...
Classes | |
struct | idx_t |
Sort the raw outputs. More... | |
class | index_creator |
Define class for creating index. More... | |
struct | sysinfo |
Define structure sysinfo. More... | |
struct | range |
Structure defines data range. More... | |
class | swarmdb |
Defines swarmdb class. More... | |
Enumerations | |
enum | planets_coordinate_system_t |
Execute a query on the datafile. More... | |
Functions | |
bool | sort_binary_log_file (const std::string &outfn, const std::string &infn) |
Sort the binary file. | |
void | set_keplerian_output (const planets_coordinate_system_t &coordinate_system=jacobi) |
Set the output format of the execute to be in Keplerian coordinates. | |
void | set_cartesian_output (const planets_coordinate_system_t &coordinate_system=origin) |
Set the output format of the execute to be in Cartesian coordinates. | |
void | set_coordinate_system (const planets_coordinate_system_t &coordinate_system) |
Set the output format of the execute for the coordinates. More... | |
std::ostream & | output_record (std::ostream &out, gpulog::logrecord &lr, const body_range_t &bod=body_range_t()) |
Pretty print a log record to the output. More... | |
template<typename T > | |
T | arg_parse (const std::string &s) |
Parse the input. | |
template<typename T > | |
void | validate (boost::any &v, const std::vector< std::string > &values, range< T > *target_type, int) |
Parser for range datatype to use with boost::program_options. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &out, const range< T > &r) |
Petty print a range object. More... | |
This namespace contains routines for opening and querying a swarm log file.
Swarm log file is a binary file with a simple textual header and a number of fixed size C structs (gpulog::logrecord).
swarmdb is used to open the log file and query it. API users should only interact with swarmdb.
swarmdb uses indexes for fast retrieval of data. The indexes are built the first time file is opened and then cached on disk. There are two indexes:
Although sort_binary_output_file function can be used to sort the entire data file, there is no reason to do so. Since all the accesses to the file go through the index.
Execute a query on the datafile.
The query consists of ranges for time (T), systems (sys) and bodies (bod)
datafile | Filename for the swarm binary log to query from |
T | Range of times to output |
sys | Range of systems to output |
bod | Range of bodies to output |
std::ostream& swarm::query::operator<< | ( | std::ostream & | out, |
const range< T > & | r | ||
) |
std::ostream & swarm::query::output_record | ( | std::ostream & | out, |
gpulog::logrecord & | lr, | ||
const body_range_t & | bod = body_range_t() |
||
) |
void swarm::query::set_coordinate_system | ( | const planets_coordinate_system_t & | coordinate_system) |
Set the output format of the execute for the coordinates.
coordinate_system | Choice of coordinate system, c.f. planets_coordinate_system_t |
void swarm::query::validate | ( | boost::any & | v, |
const std::vector< std::string > & | values, | ||
range< T > * | target_type, | ||
int | |||
) |