PrtC Class Reference

Class template provides stream formatting of defining data for other CalcLib class templates. More...

#include <PrtC.h>

List of all members.

Public Types

 CHAR = 0
 CHAR_UNSIGNED
 DOUBLE
 DOUBLE_LONG
 FLOAT
enum  FTYPE { LABEL = 0, MARGIN, INDENT, TYPE, XTYPE, YTYPE, PRECISION, WIDTH, FTYPE_CNT }
 FTYPE_CNT
 INDENT
 INT
 INT_UNSIGNED
 LABEL = 0
 LONG
 LONG_UNSIGNED
 MARGIN
enum  PDATA { CHAR = 0, CHAR_UNSIGNED, SHORT, SHORT_UNSIGNED, INT, INT_UNSIGNED, LONG, LONG_UNSIGNED, FLOAT, DOUBLE, DOUBLE_LONG, PDATA_CNT }
 PDATA_CNT
 PRECISION
 SHORT
 SHORT_UNSIGNED
 TYPE
 WIDTH
 XTYPE
 YTYPE

Public Member Functions

const char * getChar (enum PrtC::FTYPE fType) const
int getInt (enum PrtC::FTYPE fType) const
 PrtC (const PrtC &pr)
 PrtC (enum PrtC::PDATA eType, const char *cLabel=DEF_LBL, const char *cMargin=DEF_SPC3, const char *cIndent=DEF_SPC3, int iWidth=DEF_WDT, int iPrecision=DEF_PRC)
 PrtC (const char *cType, const char *cLabel=DEF_LBL, const char *cMargin=DEF_SPC3, const char *cIndent=DEF_SPC3, int iWidth=DEF_WDT, int iPrecision=DEF_PRC)
 PrtC (void)
bool setFormat (const char *strX, const char *strY)
bool setFormat (enum PrtC::PDATA indX, enum PrtC::PDATA indY)
bool setFormat (const char *str)
bool setFormat (enum PrtC::PDATA index)
bool setFormat (enum PrtC::FTYPE fType, int num)
bool setFormat (enum PrtC::FTYPE fType, const char *str)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const NNurb< xType, yType > &nu)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const NCube< xType, yType > &cu)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const NIntp< xType, yType > &ni)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const EndCube< xType, yType > *ep, int n)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const EndCube< xType, yType > &ec)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const Nurb< xType, yType > &nu) const
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const Cube< xType, yType > &cu)
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const Intp< xType, yType > &in) const
template<typename bType>
bool stream (std::ostream &ostr, const Mtx< bType > &mt) const
template<typename xType, typename yType>
bool stream (std::ostream &ostr, const Cheb< xType, yType > &ch) const
virtual ~PrtC (void)

Static Public Attributes

static const int BUF_CNT = 10
static const int BUF_STR = 256
static const char *const DEF_LBL = "CalcLib"
static const int DEF_PRC = 5
static const char *const DEF_SPC3 = " "
static const char *const DEF_TYP = PNAME[DOUBLE]
static const int DEF_WDT = 13
static const int INTP_CNT = 5
static const char *const PNAME [PDATA_CNT]
static const char *const PNAME_ENDCUBE = "EndCube"
static const char *const SNAME_CHEB = "Cheb Function Interpolation"
static const char *const SNAME_END = " Parameters"
static const char *const SNAME_ENDCUBE = "EndCube Derivative Identifier"
static const char *const SNAME_INTP = "Intp Tabular Interpolation"
static const char *const SNAME_NINTP = "NIntp Multi-Dimensional Tabular Interpolation"
static const char *const SYM_BLANK = " "
static const char *const SYM_COMMENT = "// "
static const char *const SYM_CONSTANT = "const "
static const char *const SYM_NULL = ""
static const char *const SYM_POINTER = "*"
static const char *const TNAME [INTP_CNT]
static const char *const TNAME_CHEB = "Polynomial Coefficient"
static const char *const TNAME_CNT = "Characteristic Data Point Count"
static const char *const TNAME_END = " Data Array"
static const char *const TNAME_NCNT = "Data Count by Dimension"
static const char *const TNAME_OCNT = "Polynomial Data Point Count"
static const char *const VNAME [INTP_CNT]
static const char *const VNAME_CHEB = "arC"
static const char *const VNAME_CNT = "nPoints"
static const char *const VNAME_ENDCUBE = "endCube"
static const char *const VNAME_MTX = "arM"
static const char *const VNAME_NCNT = "arNn"
static const char *const VNAME_NDIM = "n"
static const char *const VNAME_OCNT = "arOn"


Detailed Description

Class template provides stream formatting of defining data for other CalcLib class templates.

This class prints applicable input and calculated data of CalcLib classes in a "C Style" programming code format. With little modification, the output can be directly inserted into user generated source code.

Author
efgeorge
Date
2006/07/19 13:21:43
Revision
1.2
Examples:

example_Cheb.txt, and example_NIntp.txt.


Member Enumeration Documentation

enum FTYPE

Enumeration assigns an index to a format property of the interpolation method.

Enumerator:
LABEL  index of a format label property
MARGIN  index of a format margin property
INDENT  index of a format indention property
TYPE  index of a format variable type property
XTYPE  index of a format independent variable type property for dual type templates (x type)
YTYPE  index of a format dependent variable type property for dual type templates (y type)
PRECISION  index of a format numeric precision property
WIDTH  index of a format field width property
FTYPE_CNT  format type index count

enum PDATA

Enumeration assigns an index to a primitive data type.

Enumerator:
CHAR  index of primitive data type: char
CHAR_UNSIGNED  index of primitive data type: unsigned char
SHORT  index of primitive data type: short
SHORT_UNSIGNED  index of primitive data type: unsigned short
INT  index of primitive data type: int
INT_UNSIGNED  index of primitive data type: unsigned int
LONG  index of primitive data type: long
LONG_UNSIGNED  index of primitive data type: unsigned long
FLOAT  index of primitive data type: float
DOUBLE  index of primitive data type: double
DOUBLE_LONG  index of primitive data type: double long
PDATA_CNT  primitive data type index count


Constructor & Destructor Documentation

PrtC ( void   ) 

Constructor initializes a print object with default data values.

Remarks:

PrtC ( const char *  cType,
const char *  cLabel = DEF_LBL,
const char *  cMargin = DEF_SPC3,
const char *  cIndent = DEF_SPC3,
int  iWidth = DEF_WDT,
int  iPrecision = DEF_PRC 
)

Constructor initializes a print object with user-supplied data values.

Parameters:
cType a pointer to a character string that exactly identifies the template variable type
cLabel a pointer to a character string that identifies the object and data set
cMargin a pointer to a character string that is printed at the start of every line
cIndent a pointer to a character string that is printed recursively for multi-dimensional array output
iWidth data field width of select printed values
iPrecision numeric precision format (significant digits) of printed values
Remarks:
  • Input integer values should be greater than or equal to zero.
  • Input character string pointer should not be null pointers.
  • Default values are used for undefined input parameters.
Note:

PrtC ( enum PrtC::PDATA  eType,
const char *  cLabel = DEF_LBL,
const char *  cMargin = DEF_SPC3,
const char *  cIndent = DEF_SPC3,
int  iWidth = DEF_WDT,
int  iPrecision = DEF_PRC 
)

Constructor initializes a print object with user-supplied data values.

Parameters:
eType an enumeration value identifying the primitive variable data type (see PrtC::PDATA and PrtC::PNAME)
cLabel a pointer to a character string that identifies the object and data set
cMargin a pointer to a character string that is printed at the start of every line
cIndent a pointer to a character string that is printed recursively for multi-dimensional array output
iWidth data field width of select printed values
iPrecision numeric precision format (significant digits) of printed values
Remarks:
  • Input integer values should be greater than or equal to zero.
  • Input character string pointer should not be null pointers.
  • Default values are used for undefined input parameters.
Note:

PrtC ( const PrtC pr  ) 

Copy constructor initializes a CalcLib foundation class object from the specified existing base class object.

Parameters:
pr a reference to a CalcLib print object

virtual ~PrtC ( void   )  [virtual]

Virtual destructor is a place holder, no dynamic memory is allocated.


Member Function Documentation

const char * getChar ( enum PrtC::FTYPE  fType  )  const

Function returns the identified format property character string. The data is used in stream output formatting of CalcLib data.

Parameters:
fType format index identifying the property type
Returns:
a pointer to the current string identified by the format index
Remarks:
If the object does not have the identified property, a null pointer is returned.

int getInt ( enum PrtC::FTYPE  fType  )  const

Function returns the identified format property integer value. The data is used in stream output formatting of CalcLib data.

Parameters:
fType format index identifying the property type
Returns:
the current value associated by the format index
Remarks:
If the object does not have the identified property, a negative number is returned.

bool setFormat ( const char *  strX,
const char *  strY 
)

Function sets dual variable type string format properties of the object by storing the identified string pair. The data is used in stream output formatting of identifying data.

Parameters:
strX a pointer to a text string identifying the independent variable type (x type)
strY a pointer to a text string identifying the solution variable type (y Type)
Returns:
status flag
  • false (successful execution)
  • true (execution error, parameter not set)
Remarks:
  • The default type strings are set as PrtC::DEF_TYP.
  • The type string property used in single type templates remains unchanged.

bool setFormat ( enum PrtC::PDATA  indX,
enum PrtC::PDATA  indY 
)

Function sets dual variable type string format properties of the object by storing the identified enumerator values. The data is used in stream output formatting of identifying data.

Parameters:
indX enumerator index identifying the independent variable type (x type)
indY enumerator index identifying the solution variable type (y Type)
Returns:
status flag
  • false (successful execution)
  • true (execution error, parameter not set)
Remarks:
  • The default type strings are set as PrtC::DEF_TYP.
  • The input values should correspond to defined enumerations.
  • The type label property used in single type templates remains unchanged.

bool setFormat ( const char *  str  ) 

Function sets all variable type string format properties of the object by storing the identified enumerator value. The data is used in stream output formatting of identifying data.

Parameters:
str a pointer to a text string identifying the variable type
Returns:
status flag
  • false (successful execution)
  • true (execution error, parameter not set)
Remarks:
  • The default type string is set as PrtC::DEF_TYP.
  • Both label properties of dual type templates are set also.

bool setFormat ( enum PrtC::PDATA  index  ) 

Function sets all variable type string format properties of the object by storing the identified enumerator value. The data is used in stream output formatting of identifying data.

Parameters:
index enumerator index identifying the variable type
Returns:
status flag
  • false (successful execution)
  • true (execution error, parameter not set)
Remarks:
  • The default type string is set as PrtC::DEF_TYP.
  • The input value should correspond to a defined enumeration.
  • Both label properties of dual type templates are set also.

bool setFormat ( enum PrtC::FTYPE  fType,
int  num 
)

Function sets the identified format property by storing the identified integer value. The data is used in stream output formatting of identifying data.

Parameters:
fType format index identifying the property type
num an integer value to store
Returns:
status flag
  • false (successful execution)
  • true (execution error, parameter not set)
Remarks:
  • The default numeric precision is set as PrtC::PRC.
  • The default data field width is set as PrtC::WDT.
  • The input value should be greater than zero.

bool setFormat ( enum PrtC::FTYPE  fType,
const char *  str 
)

Function sets the identified format property by storing the identified character string. The data is used in stream output formatting of identifying data.

Parameters:
fType format index identifying the property type
str a pointer to applicable text string data
Returns:
status flag
  • false (successful execution)
  • true (execution error, parameter not set)
Remarks:
  • The default margin string is set as PrtC::MGN.
  • The default label string is set as PrtC::LBL.
  • The default type strings are set as PrtC::TYP.
Examples:
example_Cheb.txt, and example_NIntp.txt.

bool stream ( std::ostream &  ostr,
const NNurb< xType, yType > &  nn 
)

Function template prints defining calc::NNurb class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
nn a reference to a calc::NNurb object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const NCube< xType, yType > &  nc 
)

Function template prints defining calc::NCube class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
nc a reference to a calc::NCube object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const NIntp< xType, yType > &  ni 
)

Function template prints defining calc::NIntp class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
ni a reference to a calc::NIntp object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const EndCube< xType, yType > *  ep,
int  n 
)

Function template prints defining data of a calc::EndCube class array to the stream ostr. The declaration typename <yType> specifies the form of variables used in the specified template object array.

Parameters:
ostr a reference to a data stream
ep a pointer to a calc::EndCube object array
n calc::EndCube object array count
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const EndCube< xType, yType > &  ec 
)

Function template prints defining calc::EndCube class data to the stream ostr. The declaration typename <yType> specifies the form of variables used in the specified template object.

Parameters:
ostr a reference to a data stream
ec a reference to a calc::EndCube object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const Nurb< xType, yType > &  nu 
) const

Function template prints defining calc::Nurb class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
nu a reference to a calc::Nurb object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const Cube< xType, yType > &  cu 
)

Function template prints defining calc::Cube class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
cu a reference to a calc::Cube object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const Intp< xType, yType > &  in 
) const

Function template prints defining calc::Intp class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
in a reference to a calc::Intp object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const Mtx< bType > &  mt 
) const

Function template prints defining calc::Mtx class data to the stream ostr. The declaration typename <bType> specifies the form of variables used in the specified template object.

Parameters:
ostr a reference to a data stream
mt a reference to a calc::Mtx object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)

bool stream ( std::ostream &  ostr,
const Cheb< xType, yType > &  ch 
) const

Function template prints defining calc::Cheb class data to the stream ostr. The declaration typename <xType> specifies the form of independent variables used in interpolation calculations. The declaration typename <yType> specifies the form of solution variables used in interpolation calculations.

Parameters:
ostr a reference to a data stream
ch a reference to a calc::Cheb object
Returns:
status flag
  • false (successful execution)
  • true (execution error, task not completed)
Examples:
example_Cheb.txt, and example_NIntp.txt.


Member Data Documentation

const int BUF_CNT = 10 [static]

Temporary buffer array count (used to concatenate strings).

const int BUF_STR = 256 [static]

Temporary buffer character length (used to concatenate strings).

const char *const DEF_LBL = "CalcLib" [static]

default code format default data label string

const int DEF_PRC = 5 [static]

default code format numeric precision

const char *const DEF_SPC3 = " " [static]

default code format default margin string (3 blank spaces)

const char *const DEF_TYP = PNAME[DOUBLE] [static]

default code format default variable type string

const int DEF_WDT = 13 [static]

default code format numeric field width

const int INTP_CNT = 5 [static]

Count of variable labels and types used in interpolation calc::Intp data arrays output.

const char *const PNAME [static]

Initial value:

{
  "char"          ,  
  "char unsigned" ,  
  "short"         ,  
  "short unsigned",  
  "int"           ,  
  "int unsigned"  ,  
  "long"          ,  
  "long unsigned" ,  
  "float"         ,  
  "double"        ,  
  "double long"   ,  
 }
Character array assigns variable type labels to primitive data types.

const char *const PNAME_ENDCUBE = "EndCube" [static]

name of a calc::EndCube derivative data object (used in calc::Cube interpolation)

const char *const SNAME_CHEB = "Cheb Function Interpolation" [static]

calc::Cheb section title

const char *const SNAME_END = " Parameters" [static]

section title ending nomenclature

const char *const SNAME_ENDCUBE = "EndCube Derivative Identifier" [static]

calc::EndCube section title

const char *const SNAME_INTP = "Intp Tabular Interpolation" [static]

calc::Intp section title

const char *const SNAME_NINTP = "NIntp Multi-Dimensional Tabular Interpolation" [static]

calc::NIntp section title

const char *const SYM_BLANK = " " [static]

C language blank space designation

const char *const SYM_COMMENT = "// " [static]

C language comment line designation

const char *const SYM_CONSTANT = "const " [static]

C language constant value designation

const char *const SYM_NULL = "" [static]

C language null character string designation

const char *const SYM_POINTER = "*" [static]

C language pointer designation

const char *const TNAME [static]

Initial value:

{
   "Independent"    , 
   "Knot Vector"    , 
   "Dependent"      , 
   "2nd Derivative" , 
   "Control Polygon", 
 }
Character array assigns title labels to tabulated interpolation calc::Intp data arrays.

const char *const TNAME_CHEB = "Polynomial Coefficient" [static]

title of a coefficient variable array implemented in a calc::Cheb object

const char *const TNAME_CNT = "Characteristic Data Point Count" [static]

title of a data point count parameter

const char *const TNAME_END = " Data Array" [static]

array title ending nomenclature

const char *const TNAME_NCNT = "Data Count by Dimension" [static]

title of a data point count parameter

const char *const TNAME_OCNT = "Polynomial Data Point Count" [static]

title of a data point count parameter

const char *const VNAME [static]

Initial value:

{
   "arX",   
   "arK",   
   "arY",   
   "arD",   
   "arP",   
 }
Character array assigns variable name labels to tabulated interpolation calc::Intp data arrays.

const char *const VNAME_CHEB = "arC" [static]

name of a Chebyshev polynomial coefficient array (y units)

const char *const VNAME_CNT = "nPoints" [static]

name of a data point count parameter

const char *const VNAME_ENDCUBE = "endCube" [static]

name of a calc::EndCube derivative data object (used in calc::Cube interpolation)

const char *const VNAME_MTX = "arM" [static]

name of a 2-D Matrix array

const char *const VNAME_NCNT = "arNn" [static]

name of a polynomial data count by dimension parameter

const char *const VNAME_NDIM = "n" [static]

name suffix of a multi-dimensional array

const char *const VNAME_OCNT = "arOn" [static]

name of a polynomial data point count parameter


The documentation for this class was generated from the following files:
Generated on Wed Jul 19 09:24:21 2006 for CalcLib by  doxygen 1.4.7