Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
RackContext Class Reference

Resources provided separately for each thread. More...

#include <resources.h>

Inheritance diagram for RackContext:
Inheritance graph
[legend]
Collaboration diagram for RackContext:
Collaboration graph
[legend]

Public Member Functions

 RackContext ()
 Initializes data and image pointers to default targets or NULL.
 
 RackContext (const RackContext &ctx)
 Essential in cloning base context for threads (parallel execution of scripts).
 
std::string getFormattedStatus (const std::string &s) const
 
bool guessDatasetGroup (const Hi5Tree &src, ODIMPathElem &pathElem) const
 
bool guessDatasetGroup (ODIMPathElem &pathElem)
 
template<typename T , typename ... TT>
Hi5Tree & getHi5 (const T &filter, const TT &... filters)
 
Hi5Tree & getHi5Full (Hi5RoleFlagger::ivalue_t filter)
 
Hi5Tree & getHi5 ()
 
CompositegetComposite (Hi5RoleFlagger::ivalue_t filter)
 
ODIMPath findImage (const DataSelector &imageSelector)
 Uses image selector to find 2D data in the curneent HDF5 structure.
 
ODIMPath findImage ()
 
const drain::image::ImagegetCurrentGrayImage ()
 Light and lazy.
 
const drain::image::ImagegetCurrentImage ()
 Light and lazy.
 
const drain::image::ImageupdateCurrentImage ()
 Ensures current image. More...
 
drain::image::ImagegetModifiableImage ()
 Return current image, if modifiable. Else, copy (convert). More...
 
void convertGrayImage (const drain::image::Image &srcImage)
 
- Public Member Functions inherited from ProductConf
 ProductConf ()
 Default constructor.
 
 ProductConf (const ProductConf &conf)
 Copy constructor.
 
- Public Member Functions inherited from SmartContext
 SmartContext (const std::string &basename=__FUNCTION__)
 
 SmartContext (const SmartContext &ctx)
 
- Public Member Functions inherited from Context
 Context (const std::string &basename=__FUNCTION__)
 
 Context (const Context &ctx)
 
long int getId () const
 
const std::string & getName () const
 
virtual const drain::VariableMapgetStatusMap () const
 A long description of context variables and other resources. More...
 
virtual drain::VariableMapgetStatusMap ()
 
virtual drain::VariableMapgetUpdatedStatusMap ()
 
const VariablegetStatus (const std::string &key, bool update) const
 
template<class T >
void setStatus (const std::string &key, const T &value)
 
virtual void report (StatusFlags &flags)
 Report status. Typically, report final status of a thread to its base context. More...
 
- Public Member Functions inherited from GraphicsContext
 GraphicsContext ()
 Default constructor.
 
 GraphicsContext (const GraphicsContext &ctx)
 Copy constructor.
 
- Public Member Functions inherited from ImageContext
 ImageContext ()
 Default constr.
 
 ImageContext (const ImageContext &ctx)
 Copy constr.
 
void setCurrentImageColor (const Image &src)
 
void setCurrentImages (const Image &src)
 
void unsetCurrentImages ()
 
void getImageStatus (drain::FlexVariableMap &statusMap) const
 
Palette & getPalette ()
 
Palette & getPalette (const std::string &key)
 
void updateImageStatus (drain::VariableMap &statusMap) const
 
- Public Member Functions inherited from AndreContext
 AndreContext (const AndreContext &ctx)
 
- Public Member Functions inherited from Hdf5Context
 Hdf5Context (const Hdf5Context &ctx)
 
Hi5Tree & getMyHi5 (Hi5RoleFlagger::ivalue_t filter=(CARTESIAN|POLAR|INPUT|CURRENT))
 Pointer to the last HDF5 structure in Cartesian coordinates: input or Cartesian product. More...
 
Hi5Tree & getHi5Defunct (Hi5RoleFlagger::ivalue_t filter)
 Derives the most relevant polar data (input or product) and returns it. More...
 

Static Public Member Functions

static RackContextgetSharedContext ()
 
- Static Public Member Functions inherited from ImageContext
static void getImageInfo (const Image *ptr, drain::Variable &entry)
 Protected: More...
 

Public Attributes

hi5::Reader::ModeFlagger inputFilter
 
std::string inputPrefix
 Path prefix for input files. Move to resources?
 
std::string outputPrefix
 Path prefix for output files. Move to resources?
 
Composite composite
 TODO: inherit from ProductBase.
 
- Public Attributes inherited from ProductConf
DataSelector dataSelector
 
std::string targetEncoding
 How the (main) output is encoded.
 
ODIMPathElem appendResults
 If set, appends outputs in an hdf5 structure instead of overwriting. More...
 
OutputFlagger outputDataVerbosity = DEFAULT
 
- Public Attributes inherited from Context
const std::string basename
 Used by copy const.
 
Log log
 
StatusFlags statusFlags
 Optional log filename (syntax): when defined, automatically opened by CommandBank::run() More...
 
bool SCRIPT_DEFINED
 
- Public Attributes inherited from ContextKit
bool expandVariables
 
std::string formatStr
 
- Public Attributes inherited from GraphicsContext
TreeSVG svgTrack
 
PanelConfSVG svgPanelConf
 
AlignBase::Axis mainOrientation = AlignBase::Axis::HORZ
 
LayoutSVG::Direction mainDirection = LayoutSVG::Direction::INCR
 
int svgDebug = 0
 
CompleteAlignment< const AlignBase::Axis, AlignBase::Axis::HORZ > alignHorz = {AlignSVG::Topol::INSIDE, AlignBase::Pos::UNDEFINED_POS}
 
CompleteAlignment< const AlignBase::Axis, AlignBase::Axis::VERT > alignVert = {AlignSVG::Topol::INSIDE, AlignBase::Pos::UNDEFINED_POS}
 
- Public Attributes inherited from ImageContext
bool imagePhysical
 Defines if the next image processing operation uses scaled intentsites instead of raw byte values.
 
ODIMPathElem::group_t qualityGroups
 Defines which quality data, if any, is used as input weight. More...
 
ImageSampler imageSampler
 
const ImagecurrentImage
 Pointer to the last 2D data (image) processed.
 
const ImagecurrentGrayImage
 Pointer to the last single-channel 2D data (image) processed.
 
Image grayImage
 
Image colorImage
 
std::string paletteKey
 
- Public Attributes inherited from AndreContext
std::string andreSelect
 
float defaultQuality
 
- Public Attributes inherited from Hdf5Context
std::string select
 
std::string inputSelect
 
Hi5Tree polarInputHi5
 The last input file read, typically a volume. May be concatenated ie. read in incrementally.
 
Hi5Tree polarProductHi5
 The polar product that has been generated from the volume.
 
Hi5Tree cartesianHi5
 A single-radar Cartesian product or a multi-radar composite (mosaic).
 
Hi5Tree * currentHi5
 Pointer to the last HDF5 structure read or generated.
 
Hi5Tree * currentPolarHi5
 Pointer to the last HDF5 structure in polar coordinates: input volume or polar product. More...
 

Static Public Attributes

static const drain::StringMapper variableMapper
 
static const VariableFormatterODIM< drain::VariablevariableFormatter
 
static const VariableFormatterODIM< drain::FlexibleVariableflexVariableFormatter
 
- Static Public Attributes inherited from ImageContext
static std::string outputQuantitySyntax
 

Protected Member Functions

virtual void updateStatus () const final
 
- Protected Member Functions inherited from Context
void init ()
 
- Protected Member Functions inherited from Hdf5Context
void updateHdf5Status (drain::VariableMap &statusMap) const
 Derives the most relevant polar input data and returns it. More...
 

Static Protected Member Functions

static RackContextbaseCtx ()
 

Additional Inherited Members

- Public Types inherited from ProductConf
enum  OutputDataVerbosity { DEFAULT =0 , INTERMEDIATE =1 , DEBUG =2 , QUALITY =4 }
 Determines if also intermediate results (1) are saved. See –store.
 
typedef drain::EnumFlagger< drain::MultiFlagger< OutputDataVerbosity > > OutputFlagger
 
- Public Types inherited from Hdf5Context
enum  Hi5Role {
  CURRENT =1 , INPUT =2 , POLAR =4 , CARTESIAN =8 ,
  EMPTY =16 , PRIVATE =32 , SHARED =64
}
 
typedef drain::EnumFlagger< drain::MultiFlagger< Hi5Role > > Hi5RoleFlagger
 
- Protected Attributes inherited from Context
const long int id
 
const std::string name
 
drain::VariableMap statusMap
 
- Static Protected Attributes inherited from Hdf5Context
static Hi5Tree empty
 

Detailed Description

Resources provided separately for each thread.

Member Function Documentation

◆ convertGrayImage()

void convertGrayImage ( const drain::image::Image srcImage)

TODO: wrap this and –convert to same code

◆ getComposite()

Composite & getComposite ( Hi5RoleFlagger::ivalue_t  filter)

Get composite, preferring either shared or private (if defined).

Both ways, a defined composite is preferred.

Returns
Object containing compositing arrays.

◆ getHi5()

Hi5Tree& getHi5 ( const T &  filter,
const TT &...  filters 
)
inline
Parameters
filter- flags marking the allowed/desired properties (POLAR, INPUT, ...)
Returns
Requested data object, with properties defined by filter.
Parameters
filter- flags marking the allowed/desired properties (POLAR, INPUT, ...) in order of preference
Returns
Requested data object, with properties defined by filter.

◆ getModifiableImage()

drain::image::Image & getModifiableImage ( )

Return current image, if modifiable. Else, copy (convert).

Ensure

◆ updateCurrentImage()

const drain::image::Image & updateCurrentImage ( )

Ensures current image.

selection: find a new image, if requested.

encoding: convert if needed *

◆ updateStatus()

void updateStatus ( ) const
finalprotectedvirtual

Miscellaneous

Reimplemented from Context.

Member Data Documentation

◆ variableMapper

const drain::StringMapper variableMapper
static

Special chars accepted:

  • colon (:) for ODIM variable names prefixed with "where:", "where:", and "how:"
  • pipe (|) for separating optional string processing
  • colon (%) for time formatting (after pipe '|')

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