shibboleth-3.0.4
shibsp::SimpleAttribute Class Reference

An Attribute whose values are simple strings. More...

#include <shibsp/attribute/SimpleAttribute.h>

Inheritance diagram for shibsp::SimpleAttribute:
Collaboration diagram for shibsp::SimpleAttribute:

Public Member Functions

 SimpleAttribute (const std::vector< std::string > &ids)
 Constructor. More...
 
 SimpleAttribute (DDF &in)
 Constructs based on a remoted SimpleAttribute. More...
 
std::vector< std::string > & getValues ()
 Returns the set of values encoded as UTF-8 strings. More...
 
void clearSerializedValues ()
 Informs the Attribute that values have changed and any serializations must be cleared.
 
DDF marshall () const
 Marshalls an Attribute for remoting. More...
 
- Public Member Functions inherited from shibsp::Attribute
const char * getId () const
 Returns the Attribute identifier. More...
 
const std::vector< std::string > & getAliases () const
 Returns all of the effective names for the Attribute. More...
 
std::vector< std::string > & getAliases ()
 Returns all of the effective names for the Attribute. More...
 
void setCaseSensitive (bool caseSensitive)
 Sets whether case sensitivity should apply to basic value comparisons. More...
 
void setInternal (bool internal)
 Sets whether the attribute should be exported for CGI use. More...
 
bool isCaseSensitive () const
 Indicates whether case sensitivity should apply to basic value comparisons. More...
 
bool isInternal () const
 Indicates whether the attribute should be exported for CGI use. More...
 
virtual size_t valueCount () const
 Returns the number of values. More...
 
virtual const std::vector< std::string > & getSerializedValues () const
 Returns serialized Attribute values encoded as UTF-8 strings. More...
 
virtual const char * getString (size_t index) const
 Gets the string equivalent of the value at the specified position (starting from zero). More...
 
virtual const char * getScope (size_t index) const
 Gets the "scope" of the value at the specified position (starting from zero). More...
 
virtual void removeValue (size_t index)
 Removes the value at the specified position (starting from zero). More...
 

Additional Inherited Members

- Public Types inherited from shibsp::Attribute
typedef AttributeAttributeFactory(DDF &in)
 A function that unmarshalls remoted data into the proper Attribute subclass.
 
- Static Public Member Functions inherited from shibsp::Attribute
static Attributeunmarshall (DDF &in)
 Unmarshalls a remoted Attribute. More...
 
static void registerFactory (const char *type, AttributeFactory *factory)
 Registers an AttributeFactory function for a given attribute "type". More...
 
static void deregisterFactory (const char *type)
 Deregisters an AttributeFactory function for a given attribute "type". More...
 
static void deregisterFactories ()
 Clears the map of factories.
 
- Protected Member Functions inherited from shibsp::Attribute
 Attribute (const std::vector< std::string > &ids)
 Constructor. More...
 
 Attribute (DDF &in)
 Constructs based on a remoted Attribute. More...
 
- Protected Attributes inherited from shibsp::Attribute
std::vector< std::string > m_serialized
 Maintains a copy of serialized attribute values, when possible. More...
 

Detailed Description

An Attribute whose values are simple strings.

Constructor & Destructor Documentation

◆ SimpleAttribute() [1/2]

shibsp::SimpleAttribute::SimpleAttribute ( const std::vector< std::string > &  ids)

Constructor.

Parameters
idsarray with primary identifier in first position, followed by any aliases

◆ SimpleAttribute() [2/2]

shibsp::SimpleAttribute::SimpleAttribute ( DDF in)

Constructs based on a remoted SimpleAttribute.

Parameters
ininput object containing marshalled SimpleAttribute

Member Function Documentation

◆ getValues()

std::vector<std::string>& shibsp::SimpleAttribute::getValues ( )

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

For simple values, the serialized form is just the actual string, so the value array can be directly manipulated.

Returns
a mutable vector of the values

◆ marshall()

DDF shibsp::SimpleAttribute::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.


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