BDE 4.14.0 Production release
Loading...
Searching...
No Matches
ball_managedattributeset

Detailed Description

Outline

Purpose

Provide a container for managed attributes.

Classes

See also
ball_managedattribute, ball_rule

Description

This component implements a value-semantic container class, ball::ManagedAttributeSet, that manages a set of ball::ManagedAttribute objects.

This component participates in the implementation of "Rule-Based Logging". For more information on how to use that feature, please see the package-level documentation and usage examples for "Rule-Based Logging".

Usage

In this section we show intended usage of this component.

Example 1: Basic Properties of ball::ManagedAttributeSet

This example shows basic operations on a managed attribute set.

First, we create an empty attribute set:

Definition ball_managedattributeset.h:127

Then, we add two attributes to the attribute set:

ball::ManagedAttribute p1("uuid", 4044457);
assert(attributeSet.addAttribute(p1));
assert(attributeSet.addAttribute(ball::ManagedAttribute("uuid", 3133246)));
bool addAttribute(const ManagedAttribute &value)
Definition ball_managedattributeset.h:338
Definition ball_managedattribute.h:117

Next, we look up (by value) via the isMember method:

assert(attributeSet.isMember(p1));
assert(attributeSet.isMember(ball::ManagedAttribute("uuid", 3133246)));
bool isMember(const ManagedAttribute &value) const
Definition ball_managedattributeset.h:382

Then, we add duplicated value and observe the status of the operation:

assert(!attributeSet.addAttribute(ball::ManagedAttribute("uuid",
3133246)));

Finally, we remove an attribute and check that it is not a member of the attribute set:

assert(attributeSet.removeAttribute(p1));
assert(!attributeSet.isMember(p1));
bool removeAttribute(const ManagedAttribute &value)
Definition ball_managedattributeset.h:350