dca_interface  6.3.4
dca::Groups Class Reference

#include <base_groups.h>

Detailed Description

Definition of a container class for Group objects.

See also
CategoriesInfo, Group
void EnumerateCategoriesInfo( const dca::DcaInstance& myDca )
{
// assume we have a successfully initialized DcaInstance myDca
// get internal DCA categories info related to URL signature database...
const dca::CategoriesInfo myCategoriesInfo = myDca.getCategoriesInfo( DCA_CAT_INFO_TYPE_URL );
// enumerate categories...
{
const dca::Categories myCategories = myCategoriesInfo.getCategories();
const DCA_SIZE_TYPE numOfCategories = myCategories.size();
for( DCA_INDEX_TYPE i = 0; i < numOfCategories; ++i ) {
dca::Category myCategory = myCategories[ i ];
cout << (i+1)
<< ") Category name=" << myCategory.name( "" )
<< ", id=" << myCategory.id()
<< ", groupId=" << myCategory.groupId() << endl;
}
}
// enumerate groups...
{
const dca::Groups myGroups = myCategoriesInfo.getGroups();
const DCA_SIZE_TYPE numOfGroups = myGroups.size();
for( DCA_INDEX_TYPE i = 0; i < numOfGroups; ++i ) {
dca::Group myGroup = myGroups[ i ];
cout << (i+1)
<< ") Group name=" << myGroup.name( "" )
<< ", id=" << myGroup.id() << endl;
}
}
// enumerate locales...
{
const dca::Locales myLocales = myCategoriesInfo.getLocales();
const DCA_SIZE_TYPE numOfLocales = myLocales.size();
for( DCA_INDEX_TYPE i = 0; i < numOfLocales; ++i ) {
dca::Locale myLocale = myLocales[ i ];
cout << (i+1)
<< ") Locale displayName='" << myLocale.displayName()
<< "', languageId='" << myLocale.languageId() << "'"
<< endl;
}
}
}

Definition at line 33 of file base_groups.h.

Public Member Functions

Group at (DCA_INDEX_TYPE index) const
 Access to a group with the given index. More...
 
Group operator[] (DCA_INDEX_TYPE index) const
 Access to a group with the given index. More...
 
DCA_SIZE_TYPE size () const
 The number of items in the container.
 
Group byId (DCA_GROUP_ID_TYPE id) const
 Returns the group with the given group id. More...
 

Member Function Documentation

◆ at()

Group dca::Groups::at ( DCA_INDEX_TYPE  index) const

Access to a group with the given index.

Parameters
[in]indexThe index of the group. Range is from 0 to size() - 1
Returns
A Group object for the given index in the container.
Note
Throws an exception of type dca::ExDca if given index is out of range.

◆ operator[]()

Group dca::Groups::operator[] ( DCA_INDEX_TYPE  index) const

Access to a group with the given index.

Parameters
[in]indexThe index of the group. Range is from 0 to size() - 1
Returns
A Group object for the given index in the container.
Note
Throws an exception of type dca::ExDca if given index is out of range.

◆ byId()

Group dca::Groups::byId ( DCA_GROUP_ID_TYPE  id) const

Returns the group with the given group id.

Parameters
[in]idThe id of the requested group
Returns
A Group object for the given id in the container.

The documentation for this class was generated from the following file:
const DCA_CATEGORIES_INFO_TYPE DCA_CAT_INFO_TYPE_URL
Refers to the internal categories info for URL classification.
DCA_SIZE_TYPE size() const
Returns the number of categories in the container.
Definition of a container class for Category objects.
CategoriesInfo getCategoriesInfo(DCA_CATEGORIES_INFO_TYPE categoryType) const
Returns the DCA internal categories, groups and locales.
Encapsulation of a locale class, which allows access to the language id and the display name of local...
Definition: base_locale.h:28
DCA_GROUP_ID_TYPE id() const
Returns the id of the group as defined in the related categories XML schema.
A container class that allows access to the contained Categories, Groups and Locales.
DCA_CATEGORY_ID_TYPE id() const
The category id.
DCA_SIZE_TYPE size() const
Returns the number of categories in the container.
Definition of a container class for Group objects.
Definition: base_groups.h:34
std::string name(const std::string &localeString=std::string()) const
Returns the localized (display) name of the group.
Locales getLocales() const
Returns the contained Locales.
Encapsulates the init and deinit of the DCA API.
Definition: base_classes.h:315
DCA_SIZE_TYPE size() const
The number of items in the container.
size_t DCA_INDEX_TYPE
Type for index access (used for arrays and collections).
Definition: base_types.h:66
Categories getCategories() const
Returns the contained Categories.
size_t DCA_SIZE_TYPE
Type for size (used for size of array and collections).
Definition: base_types.h:72
std::string name(const std::string &localeString=std::string()) const
Returns the localized (display) name of the category.
std::string displayName() const
Returns the display name of the locale.
DCA_GROUP_ID_TYPE groupId() const
If the category is associated with a group, this is the group id.
Definition of a container class for Locale objects.
Definition: base_locales.h:34
std::string languageId() const
Returns the language id as defined in the related categories.xml.
Encapsulates a group as defined in the related categories XML schema (see Categories XML: Groups).
Definition: base_group.h:26
Encapsulates a category as defined in the categories XML schema (see Categories XML: Categories).
Definition: base_category.h:26
Groups getGroups() const
Returns the contained Groups.