shibsp::ScopedAttribute Class Reference

An Attribute whose values are relations of a value and a scope. More...

#include <shibsp/attribute/ScopedAttribute.h>

Inheritance diagram for shibsp::ScopedAttribute:
shibsp::Attribute

List of all members.

Public Member Functions

 ScopedAttribute (const std::vector< std::string > &ids, char delimeter='@')
 Constructor.
 ScopedAttribute (DDF &in)
 Constructs based on a remoted ScopedAttribute.
std::vector< std::pair
< std::string, std::string > > & 
getValues ()
 Returns the set of values encoded as UTF-8 strings.
const std::vector< std::pair
< std::string, std::string > > & 
getValues () const
 Returns the set of values encoded as UTF-8 strings.
size_t valueCount () const
 Returns the number of values.
void clearSerializedValues ()
 Informs the Attribute that values have changed and any serializations must be cleared.
const char * getString (size_t index) const
 Gets the string equivalent of the value at the specified position (starting from zero).
const char * getScope (size_t index) const
 Gets the "scope" of the value at the specified position (starting from zero).
void removeValue (size_t index)
 Removes the value at the specified position (starting from zero).
const std::vector< std::string > & getSerializedValues () const
 Returns serialized Attribute values encoded as UTF-8 strings.
DDF marshall () const
 Marshalls an Attribute for remoting.

Detailed Description

An Attribute whose values are relations of a value and a scope.

In practice, scoped attributes are simple pairs of strings instead of a single string. They can be expressed as a string easily using a delimeter, typically an '@' symbol. The scope concept allows certain kinds of filtering to be performed more intelligently and efficiently, although not all scoped attributes can be effectively filtered (e.g. if the set of scope values is unconstrained).


Constructor & Destructor Documentation

shibsp::ScopedAttribute::ScopedAttribute ( const std::vector< std::string > &  ids,
char  delimeter = '@' 
)

Constructor.

Parameters:
ids array with primary identifier in first position, followed by any aliases
delimeter value/scope delimeter when serializing
shibsp::ScopedAttribute::ScopedAttribute ( DDF in  ) 

Constructs based on a remoted ScopedAttribute.

Parameters:
in input object containing marshalled ScopedAttribute

Member Function Documentation

const char* shibsp::ScopedAttribute::getScope ( size_t  index  )  const [virtual]

Gets the "scope" of the value at the specified position (starting from zero).

Parameters:
index position of value
Returns:
the specified value's "scope", or nullptr if attribute is unscoped

Reimplemented from shibsp::Attribute.

const std::vector<std::string>& shibsp::ScopedAttribute::getSerializedValues (  )  const [virtual]

Returns serialized Attribute values encoded as UTF-8 strings.

Returns:
an immutable vector of values

Reimplemented from shibsp::Attribute.

const char* shibsp::ScopedAttribute::getString ( size_t  index  )  const [virtual]

Gets the string equivalent of the value at the specified position (starting from zero).

Parameters:
index position of value
Returns:
the specified value in its "string" form, or nullptr if undefined

Reimplemented from shibsp::Attribute.

const std::vector< std::pair<std::string,std::string> >& shibsp::ScopedAttribute::getValues (  )  const

Returns the set of values encoded as UTF-8 strings.

Each compound value is a pair containing the simple value and the scope.

Returns:
an immutable vector of the values
std::vector< std::pair<std::string,std::string> >& shibsp::ScopedAttribute::getValues (  ) 

Returns the set of values encoded as UTF-8 strings.

Each compound value is a pair containing the simple value and the scope.

Returns:
a mutable vector of the values
DDF shibsp::ScopedAttribute::marshall (  )  const [virtual]

Marshalls an Attribute for remoting.

This allows Attribute objects to be communicated across process boundaries without excess XML parsing. The DDF returned must be a struct containing a single list member named with the Attribute's "id". The name of the struct should contain the registered name of the Attribute implementation.

Reimplemented from shibsp::Attribute.

void shibsp::ScopedAttribute::removeValue ( size_t  index  )  [virtual]

Removes the value at the specified position (starting from zero).

Parameters:
index position of value to remove

Reimplemented from shibsp::Attribute.

size_t shibsp::ScopedAttribute::valueCount (  )  const [virtual]

Returns the number of values.

Returns:
number of values

Reimplemented from shibsp::Attribute.


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

Generated on 15 Nov 2017 for shibboleth-2.6.1 by  doxygen 1.6.1