PreEmptive Analytics Linux Client
 All Classes Files Functions Variables Typedefs Macros
Public Member Functions | Static Public Member Functions | List of all members
FieldLimiter Class Reference

Restricts the length of attribute values based on the combination of tag and attribute name. More...

Public Member Functions

DLL_PACLIENT FieldLimiter ()
 Create an empty FieldLimiter. More...
 
DLL_PACLIENT ~FieldLimiter ()
 Dispose of a FieldLimiter instance. More...
 
DLL_PACLIENT void AddLimit (const wchar_t *tag, const wchar_t *attribute, size_t limit)
 Add a length limit for an attribute based on tag. More...
 
DLL_PACLIENT size_t GetLimit (const wchar_t *tag, const wchar_t *attribute)
 Get a length limit for an attribute based on tag. More...
 
DLL_PACLIENT FieldLimiteroperator= (const FieldLimiter *other)
 Copy the values of another FieldLimiter instance. More...
 
DLL_PACLIENT FieldLimiteroperator= (const FieldLimiter &other)
 Copy the values of another FieldLimiter instance. More...
 
DLL_PACLIENT void RemoveLimit (const wchar_t *tag, const wchar_t *attribute)
 Remove a length limit for an attribute based on tag. More...
 

Static Public Member Functions

static void Defaults (FieldLimiter *limits)
 Get a FieldLimiter already initialized with a set of default limits. More...
 

Detailed Description

Restricts the length of attribute values based on the combination of tag and attribute name.

The FieldLimiter is used by the MessageMarshaller to control the length of attribute values for various tags. An instance of a FieldLimiter can be passed into Configuration::Configuration() but if one is not provided a default instance is used.

Constructor & Destructor Documentation

DLL_PACLIENT FieldLimiter::FieldLimiter ( )

Create an empty FieldLimiter.

After a FieldLimiter has been created you can add limits by tag and attribute name using FieldLimiter::AddLimit()
DLL_PACLIENT FieldLimiter::~FieldLimiter ( )

Dispose of a FieldLimiter instance.

Member Function Documentation

DLL_PACLIENT void FieldLimiter::AddLimit ( const wchar_t *  tag,
const wchar_t *  attribute,
size_t  limit 
)

Add a length limit for an attribute based on tag.

If an attribute with the same name and tag already had a limit, its limit is replaced. A limit of 0 is consindered to be no limit.
Parameters
tagName of the tag to which the attribute belongs
attributeName of the attribute
limitMaximum length of the attribute's value transmitted
static void FieldLimiter::Defaults ( FieldLimiter limits)
static

Get a FieldLimiter already initialized with a set of default limits.

The limits used by default are based on requirements used by PreEmptive Analytics for TFS
Returns
An instance of FieldLimiter with PA-TFS required defaults
DLL_PACLIENT size_t FieldLimiter::GetLimit ( const wchar_t *  tag,
const wchar_t *  attribute 
)

Get a length limit for an attribute based on tag.

If an attribute with the same name and tag already had a limit, its limit is replaced. A limit of 0 is consindered to be no limit.
Parameters
tagName of the tag to which the attribute belongs
attributeName of the attribute
DLL_PACLIENT FieldLimiter& FieldLimiter::operator= ( const FieldLimiter other)

Copy the values of another FieldLimiter instance.

Returns
this instance
DLL_PACLIENT FieldLimiter& FieldLimiter::operator= ( const FieldLimiter other)

Copy the values of another FieldLimiter instance.

Returns
this instance
DLL_PACLIENT void FieldLimiter::RemoveLimit ( const wchar_t *  tag,
const wchar_t *  attribute 
)

Remove a length limit for an attribute based on tag.

Parameters
tagName of the tag to which the attribute belongs
attributeName of the attribute