Brion  2.0.0
The Blue Brain C++ I/O library
brion::Target Class Reference

Read access to a Target file. More...

#include <target.h>

+ Collaboration diagram for brion::Target:

Public Member Functions

 Target (const Target &from)
 Copy-construct a target file. More...
 
 ~Target ()
 Close target file. More...
 
Targetoperator= (const Target &rhs)
 Assign a different target. More...
 

Friends

std::ostream & operator<< (std::ostream &, const Target &)
 Stream out content of target file. More...
 

Read API

 Target (const std::string &source)
 Open the given source to a target file for reading. More...
 
const Strings & getTargetNames (const TargetType type) const
 Get list of targets for the desired type. More...
 
bool contains (const std::string &name) const
 
const Strings & get (const std::string &name) const
 Get targets and/or GIDSet grouped by the given target. More...
 
static GIDSet parse (const Targets &targets, const std::string &name)
 Parse a given target into a GID set. More...
 

Detailed Description

Read access to a Target file.

Following RAII, this class is ready to use after the creation and will ensure release of resources upon destruction.

Definition at line 38 of file target.h.

Constructor & Destructor Documentation

brion::Target::Target ( const Target from)

Copy-construct a target file.

Version
1.6
brion::Target::~Target ( )

Close target file.

Version
1.0
brion::Target::Target ( const std::string &  source)
explicit

Open the given source to a target file for reading.

Parameters
sourcefilepath to target file
Exceptions
std::runtime_errorif file is not a valid target file
Version
1.0

Member Function Documentation

bool brion::Target::contains ( const std::string &  name) const
Returns
true if the target exists.
Version
1.7
const Strings& brion::Target::get ( const std::string &  name) const

Get targets and/or GIDSet grouped by the given target.

Parameters
nametarget name to get the values from
Returns
list of values in the target. Can be targets and/or GIDSet
Exceptions
std::runtime_errorif name is an invalid target
Version
1.0
const Strings& brion::Target::getTargetNames ( const TargetType  type) const

Get list of targets for the desired type.

Parameters
typedesired target type to look for
Returns
list of target names
Version
1.0
Target& brion::Target::operator= ( const Target rhs)

Assign a different target.

Version
1.6
static GIDSet brion::Target::parse ( const Targets &  targets,
const std::string &  name 
)
static

Parse a given target into a GID set.

All given targets are searched for the given name. If found, the named target is recursively resolved to a GID set. Empty targets are valid, i.e., does not throw when an empty target is found.

Parameters
targetsthe targets to parse
namethe target name to parse
Returns
the set of cell identifiers parsed
Exceptions
std::runtime_errorif a non-existent (sub)target is given.
Version
1.6

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ,
const Target  
)
friend

Stream out content of target file.


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