TAParam

List of ancestors:
TObj
Files:
params.h, params.cpp

Desc. & Idea Warnings Methods Attributes Operators Specials

 

Abstract  Abstract

Virtual  Virtual Overridden  Overridden
Key, Important  Key, Important Constructor  Constructor Destructor  Destructor
Methods beginning with Get or Set (get/set) are usually intended to access Attributes of same name (exceptions will be marked).

 

Description

This class represents a single parameter from the parametric file.

Title

Warnings

All output strings (char *) should be used as constants. Don't change them from outside the object. On the other hand all incoming strings are copied into the object. So the source strings can change or be deleted.
Params inserted into TGroup or TParamFile are really inserted not copied.

Title

Methods

Public:

VirtualKey, Important BOOL AsBool(void)
VirtualKey, Important char AsChar(void)
VirtualKey, Important TFit AsFit(void)
VirtualKey, Important double AsFloat(void)
VirtualKey, Important int AsInt(void)
VirtualKey, Important TProb AsProb(void)
VirtualKey, Important char * AsString(void)
void Delete()
char * GetCaption(void)
TChange GetChange(void)
TGroup * GetGrp(void)
char * GetName(void)
TAParam * GetNext(void)
TParamFile *GetParent()
TAParam * GetPrior()
TStrList *GetRemarks()
Overridden uint GetSerSize(BOOL subclass=FALSE)
TPFileID *GetSourceFile()
TTypes GetType(void)
void PutAfter(TAParam *Who)
void PutBefore(TAParam *Who)
Key, Important void SetCaption(char *aCaption)
Key, Important void SetChange(TChange aChange)
TGroup * SetGrp(TGroup *aGrp)
Key, Important void SetName(char *aName)
Overridden uint Serialize(BYTE **rawbytes,BOOL subclass=FALSE)
void SetSourceFile(TPFileID *val)
Key, Important void SetType(TTypes aType)
VirtualKey, Important void SetValue(BOOL)
VirtualKey, Important void SetValue(char)
VirtualKey, Important void SetValue(char *)
VirtualKey, Important void SetValue(double)
VirtualKey, Important void SetValue(int)
ConstructorKey, Important TAParam(char *aName=NULL, TPFileID *aSourceFile=NULL)
Constructor TAParam(TAParam &picture)
void Unchain()
Destructor ~TAParam(void)

Protected:

Constructor TAParam(BYTE** raw,uint length,BOOL subclass,char *GroupName,TParamFile *Into)

Private:

 

Title


type Astype(void)

The parameters value is returned in a format specified by type. i.g  some conversions can be made. Use the string value as a pattern, don't change it directly.

Returns

The parameters value in a required format.

See alsoTParamFile.Readtype

Section Title


void Delete()

Simply just calls the destructor.

See also~TAParam

Section Title


char * GetCaption(void)

Returns

Returns the caption of the parameter. If it is NULL string Name is returned instead.

Section Title


TParamFile *GetParent()

Returns

Returns the TParamFile structure which the parameter belongs to.

Section Title


void PutAfter(TAParam *Who)

Puts the parameter behind the specified one (if it is not NULL). Parent  can change (See alsoGetParent).

Arguments

Who...the parameter in the chain.

Section Title


void PutBefore(TAParam *Who)

Puts the parameter before the specified one (if it is not NULL). Parent  can change (See alsoGetParent). Also TParamFile.FirstParam can be affected.

Arguments

Who...the parameter in the chain.

Section Title


TGroup * SetGrp(TGroup *aGrp)

Quite a complex function. Among others parent can be changed (See alsoGetParent). If there is no FileID of the same filename as in the current parent TParamFile the old one is copied.

Arguments

aGrp...the new group

Returns

The group the parameter belongs to now.

See alsoTGroup.InjectParam, TGroup.InsertParam, TGroup.EjectParam

Section Title


void SetValue(type)

Set the value of the parameter. The type is converted into the type of parameter.

Arguments

the new value

Section Title


void SetSourceFile(TPFileID *val)

Quite a complex function. Among others parent can be changed (See alsoGetParent). If a Group of the same name as the parental is does not exist in new TParamFile it is created (empty).

Arguments

val...the new FileID.

Section Title


TAParam(char *aName=NULL, TPFileID *aSourceFile=NULL)

Constructor that creates a new parameter. The parameter doesn't belong to any group. And its type must be set.

Arguments

aName...name of the new parameter
aSourceFile...file the parameter belongs to

Section Title


TAParam(TAParam &picture)

Copy constructor. Warning: the new parameter is in no group nor chain even the SourceFile is NULL.

Arguments

picture...parameter that should be copied

Section Title


TAParam(BYTE** raw,uint length,BOOL subclass,char *GroupName,TParamFile *Into)

Deserialization constructor. Don't use separately.

Section Title


void Unchain()

Takes out the parameter from the chain. The TParamFile.FristParam is maintained.

Section Title


~TAParam(void)

Destructor. Frees also the string values.

Section Title


Attributes

Public:

Protected:

Key, Important char * Caption
Key, Important TChange Change
Key, Important TMultiType Data
TGroup * Grp
Key, Important char * Name
TAParam *Next
TAParam *Prior
TStrList *Remarks
Key, Important TPFileID *SourceFile
char *strbuf
Key, Important TTypes Type

Private:

Title


char * Caption

Caption of the parameter that should be used by the parameter setting utility. If it is NULL (The GetCaption function returns  a same pointer  as function GetName) the setting utility should not show this parameter.

Section Title


TChange Change

The changeability status of the parameter.

Section Title


TMultiType Data

A union type attribute, that contains the value of the parameter.

Section Title


TGroup * Grp

The parent group.

See alsoSetGrp

Section Title


char * Name

Name of the parameter.

Section Title


TAParam *Next

Next parameter in the structure chain.

Section Title


TAParam *Prior

Prior parameter in the structure chain.

Section Title


TStrList *Remarks

Remarks connected with the parameter.

Section Title


TPFileID *SourceFile

The FileID of the file the parameter was loaded from. (or which the parameter was added into.).

See alsoSetSourceFile

Section Title


char *strbuf

Points to a buffer for values converted to string from other types.

Section Title


TTypes Type

Type of the parameters data.

Section Title


Operators

Public:

Protected:

Private:

Title


 


Specials

Use the string values as patterns don't change them directly.

Conversions:
    BOOL->string      "FALSE" or "TRUE"
    BOOL->ordinal    0 or 1
    BOOL->char        'T' (macro TRUECHAR) or 'F' (macro FALSECHAR)
    string->BOOL       TRUE if the string is "TRUE" otherwise FALSE
    char->BOOL        'T' (TRUECHAR) to TRUE otherwise FALSE
Other conversions are obvious.

Title