# saga::cpr::directory Class Reference

A checkpoint directory contains, you guess it, checkpoints. More...

`#include <cpr_directory.hpp>`

Inheritance diagram for saga::cpr::directory:

[legend]

List of all members.

## Public Member Functions
| directory (session const &s, saga::url url, int mode=saga::cpr::ReadWrite)
| Creates the object.
| directory (saga::url url, int mode=saga::cpr::ReadWrite)
| Creates the object.
| directory (saga::object const &o)
| Creates the object.
| directory (void)
| Creates the object.
| ~directory (void)
| Destroys the object.
directory & | operator= (saga::object const &o)
| Brief description starts here.
bool | is_checkpoint (saga::url url)
| Alias for is_entry of saga::ns_directory.
saga::cpr::checkpoint | open (saga::url url, int flags=saga::cpr::Read)
| Creates a new checkpoint instance.
saga::cpr::directory | open_dir (saga::url url, int flags=saga::cpr::Read)
| Creates a new directory instance.
std::vector< saga::url > | find (std::string name_pattern, std::vector< std::string > const &meta_pattern=std::vector< std::string >(), int flags=saga::cpr::None, std::string spec="")
| Find entries in the current directory and below, with matching names and matching meta data.
void | set_parent (saga::url checkpoint, saga::url parent, int generation=1)
| set the previous checkpoint url
saga::url | get_parent (saga::url checkpoint, int generation=1)
| get the previous checkpoint url
int | get_file_num (saga::url checkpoint)
| get number of checkpoint files
std::vector< saga::url > | list_files (saga::url checkpoint)
| list the available checkpoint files
int | add_file (saga::url checkpoint, saga::url url)
| register a checkpoint file
saga::url | get_file (saga::url checkpoint, int id)
| get the url for a specific checkpoint file
saga::filesystem::file | open_file (saga::url checkpoint, int id, int flags=CreateParents|Lock|ReadWrite)
| open a specific checkpoint file by id
saga::filesystem::file | open_file (saga::url checkpoint, saga::url url, int flags=CreateParents|Lock|ReadWrite)
| open a specific checkpoint file by name
void | remove_file (saga::url checkpoint, int id)
| remove a specific checkpoint file by id
void | remove_file (saga::url checkpoint, saga::url url)
| remove a specific checkpoint file by name
void | update_file (saga::url checkpoint, int id, saga::url new_url)
| update a specific checkpoint file by id
void | update_file (saga::url checkpoint, saga::url old_url, saga::url new_url)
| update a specific checkpoint file by name
void | stage_file (saga::url checkpoint, int id, saga::url new_url)
| stage a specific checkpoint file by id
void | stage_file (saga::url checkpoint, saga::url old_url, saga::url new_url)
| stage a specific checkpoint file by name
void | stage_file (saga::url checkpoint, saga::url new_url)
| stage all checkpoint files
## Static Public Member Functions
static directory | create (session const &s, saga::url url, int mode=Read)
| Factory function resembling directory(session, url, int) constructor.
static directory | create (saga::url url, int mode=Read)
| Factory function resembling directory(url, int) constructor.
template<typename Tag>
static saga::task | create (saga::url url, int mode=Read)
| Factory function resembling entry(url, int) constructor.

## Detailed Description

A checkpoint directory contains, you guess it, checkpoints.

## Constructor & Destructor Documentation

saga::cpr::directory::directory | ( | session const & | s,
|  | saga::url | url,
|  | int | mode = `saga::cpr::ReadWrite` |
| ) |  |  |

Creates the object.

saga::cpr::directory::directory | ( | saga::url | url,
|  | int | mode = `saga::cpr::ReadWrite` |
| ) |  |  | `[explicit]`

Creates the object.

saga::cpr::directory::directory | ( | saga::object const & | o | ) | `[explicit]`

Creates the object.

Reimplemented from saga::name_space::directory.

References saga::BadParameter, saga::object::CPRDirectory, and saga::object::get_type().

saga::cpr::directory::directory | ( | void |  | ) |

Creates the object.

Reimplemented from saga::name_space::directory.

saga::cpr::directory::~directory | ( | void |  | ) |

Destroys the object.

Reimplemented from saga::name_space::directory.

## Member Function Documentation

static directory saga::cpr::directory::create | ( | session const & | s,
|  | saga::url | url,
|  | int | mode = `Read` |
| ) |  |  | `[inline, static]`

Factory function resembling directory(session, url, int) constructor.

Reimplemented from saga::name_space::directory.

static directory saga::cpr::directory::create | ( | saga::url | url,
|  | int | mode = `Read` |
| ) |  |  | `[inline, static]`

Factory function resembling directory(url, int) constructor.

Reimplemented from saga::name_space::directory.

template<typename Tag>

static saga::task saga::cpr::directory::create | ( | saga::url | url,
|  | int | mode = `Read` |
| ) |  |  | `[inline, static]`

Factory function resembling entry(url, int) constructor.

Reimplemented from saga::name_space::directory.

directory & saga::cpr::directory::operator= | ( | saga::object const & | o | ) |

Brief description starts here.

Reimplemented from saga::name_space::directory.

References saga::name_space::directory::operator=().

bool saga::cpr::directory::is_checkpoint | ( | saga::url | url | ) | `[inline]`

Alias for is_entry of saga::ns_directory.

saga::cpr::checkpoint saga::cpr::directory::open | ( | saga::url | url,
|  | int | flags = `saga::cpr::Read` |
| ) |  |  | `[inline]`

Creates a new checkpoint instance.

Parameters:

  | url | File to be opened
  | flags | Flags definition operation modus

Returns:
  Opened file instance

Reimplemented from saga::name_space::directory.

saga::cpr::directory saga::cpr::directory::open_dir | ( | saga::url | url,
|  | int | flags = `saga::cpr::Read` |
| ) |  |  | `[inline]`

Creates a new directory instance.

Parameters:

  | url | Name of directory to open
  | flags | Flags definition operation modus

Returns:
  Opened directory instance

Reimplemented from saga::name_space::directory.

std::vector<saga::url> saga::cpr::directory::find | ( | std::string | name_pattern,
|  | std::vector< std::string > const & | meta_pattern = `std::vector <std::string>()`,
|  | int | flags = `saga::cpr::None`,
|  | std::string | spec = `""` |
| ) |  |  | `[inline]`

Find entries in the current directory and below, with matching names and matching meta data.

Parameters:

  | name_pattern | Pattern for names of entries to be found
  | meta_pattern | Pattern for meta data of entries to be found
  | flags | Flags defining the operation modus

Returns:
  Array of names matching both pattern

void saga::cpr::directory::set_parent | ( | saga::url | checkpoint,
|  | saga::url | parent,
|  | int | generation = `1` |
| ) |  |  | `[inline]`

set the previous checkpoint url

Parameters:

  | location | of checkpoint
  | generation | number of generations to go backwards

saga::url saga::cpr::directory::get_parent | ( | saga::url | checkpoint,
|  | int | generation = `1` |
| ) |  |  | `[inline]`

get the previous checkpoint url

Parameters:

  | generation | number of generations to go backwards

References saga::task::get_result().

int saga::cpr::directory::get_file_num | ( | saga::url | checkpoint | ) | `[inline]`

get number of checkpoint files

Parameters:

  | checkpoint | url

References saga::task::get_result().

std::vector<saga::url> saga::cpr::directory::list_files | ( | saga::url | checkpoint | ) | `[inline]`

list the available checkpoint files

Parameters:

  | checkpoint | url

int saga::cpr::directory::add_file | ( | saga::url | checkpoint,
|  | saga::url | url |
| ) |  |  | `[inline]`

register a checkpoint file

Parameters:

  | checkpoint | url
  | file | url

saga::url saga::cpr::directory::get_file | ( | saga::url | checkpoint,
|  | int | id |
| ) |  |  | `[inline]`

get the url for a specific checkpoint file

Parameters:

  | checkpoint | url
  | file | id

saga::filesystem::file saga::cpr::directory::open_file | ( | saga::url | checkpoint,
|  | int | id,
|  | int | flags = `CreateParents | Lock | ReadWrite` |
| ) |  |  | `[inline]`

open a specific checkpoint file by id

Parameters:

  | checkpoint | url
  | file | id
  | open | flags

saga::filesystem::file saga::cpr::directory::open_file | ( | saga::url | checkpoint,
|  | saga::url | url,
|  | int | flags = `CreateParents | Lock | ReadWrite` |
| ) |  |  | `[inline]`

open a specific checkpoint file by name

Parameters:

  | checkpoint | url
  | file | url
  | open | flags

void saga::cpr::directory::remove_file | ( | saga::url | checkpoint,
|  | int | id |
| ) |  |  | `[inline]`

remove a specific checkpoint file by id

Parameters:

  | checkpoint | url
  | file | id

void saga::cpr::directory::remove_file | ( | saga::url | checkpoint,
|  | saga::url | url |
| ) |  |  | `[inline]`

remove a specific checkpoint file by name

Parameters:

  | checkpoint | url
  | file | url

void saga::cpr::directory::update_file | ( | saga::url | checkpoint,
|  | int | id,
|  | saga::url | new_url |
| ) |  |  | `[inline]`

update a specific checkpoint file by id

Parameters:

  | checkpoint | url
  | file | id
  | new | url

References saga::task::get_result().

void saga::cpr::directory::update_file | ( | saga::url | checkpoint,
|  | saga::url | old_url,
|  | saga::url | new_url |
| ) |  |  | `[inline]`

update a specific checkpoint file by name

Parameters:

  | checkpoint | url
  | old | url
  | new | url

void saga::cpr::directory::stage_file | ( | saga::url | checkpoint,
|  | int | id,
|  | saga::url | new_url |
| ) |  |  | `[inline]`

stage a specific checkpoint file by id

Parameters:

  | checkpoint | url
  | file | id
  | target | url

void saga::cpr::directory::stage_file | ( | saga::url | checkpoint,
|  | saga::url | old_url,
|  | saga::url | new_url |
| ) |  |  | `[inline]`

stage a specific checkpoint file by name

Parameters:

  | checkpoint | url
  | source | url
  | target | url

void saga::cpr::directory::stage_file | ( | saga::url | checkpoint,
|  | saga::url | new_url |
| ) |  |  | `[inline]`

stage all checkpoint files

Parameters:

  | checkpoint | url
  | target | url

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

- cpr_directory.hpp
- cpr_directory.cpp