APRONXX  0.9.12
Public Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members
apron::varname Class Reference

Stream modifier to set variable names to dimensions. More...

#include <apxx_dimension.hh>

Public Member Functions

 varname (const std::vector< std::string > &names)
 Creates a modifier to associate variable names to dimensions. More...
 

Protected Attributes

const std::vector< std::string > & names
 Names of variables. More...
 

Static Protected Attributes

static const int xindex
 Index to stream-local data, allocated with xalloc. More...
 

Friends

template<class charT , class Traits >
std::basic_ostream< charT, Traits > & operator<< (std::basic_ostream< charT, Traits > &os, const varname &v)
 Associates the modifier to the stream. More...
 
template<class charT , class Traits >
std::vector< std::string > * get_varname (std::basic_ostream< charT, Traits > &os)
 Gets the variable name vector associated to the stream. More...
 

Detailed Description

Stream modifier to set variable names to dimensions.

By default, all level 0 std::ostream printing functions output x0 to xn to refer to dimensions 0 to n. By inserting this modifier into a stream, you can customize the variable name.

The information is local to the stream.

The modifier is not used for level 1 printing functions as an environment mapping dimensions to variable names is already available. Also, the modifier does not affect the behavior of print functions that take the mapping as an (optional) argument.

Constructor & Destructor Documentation

◆ varname()

varname::varname ( const std::vector< std::string > &  names)
inline

Creates a modifier to associate variable names to dimensions.

  • names[i] is the name to give to dimension i.

If there are not enough names, printing functions will revert to xi, xi+1... To disable variable names, simply pass an empty vector.

A reference to names is kept by the object and will be passed to the stream by the modifier. The stream will then make a deep copy and the varname object and the original vector can be safely deleted.

Friends And Related Function Documentation

◆ get_varname

template<class charT , class Traits >
std::vector<std::string>* get_varname ( std::basic_ostream< charT, Traits > &  os)
friend

Gets the variable name vector associated to the stream.

Returns
a pointer to the vector formerly associated to the stream, or NULL.

◆ operator<<

template<class charT , class Traits >
std::basic_ostream<charT,Traits>& operator<< ( std::basic_ostream< charT, Traits > &  os,
const varname v 
)
friend

Associates the modifier to the stream.

Member Data Documentation

◆ names

const std::vector<std::string>& apron::varname::names
protected

Names of variables.

◆ xindex

const int apron::varname::xindex
staticprotected

Index to stream-local data, allocated with xalloc.


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