SDK  2.1.4
CloudBackend Software Development Kit - SDK API for C++
cbe::Role Class Reference

User role information. More...

#include <Role.h>

Public Types

using ListMembersDelegatePtr = delegate::ListMembersDelegatePtr
 
using ListMembersException = delegate::ListMembersDelegate::Exception
 
using ListMembersError = delegate::ListMembersDelegate::ErrorInfo
 
using AddRoleMemberDelegatePtr = delegate::AddRoleMemberDelegatePtr
 
using AddRoleMemberException = delegate::AddRoleMemberDelegate::Exception
 
using AddRoleMemberError = delegate::AddRoleMemberDelegate::ErrorInfo
 
using RemoveRoleMemberDelegatePtr = delegate::RemoveRoleMemberDelegatePtr
 
using RemoveRoleMemberException = delegate::RemoveRoleMemberDelegate::Exception
 
using RemoveRoleMemberError = delegate::RemoveRoleMemberDelegate::ErrorInfo
 

Public Member Functions

std::string name () const
 
cbe::RoleId id () const
 
cbe::GroupId groupId () const
 
void listMembers (ListMembersDelegatePtr delegate)
 Lists the members of this role,. More...
 
std::vector< cbe::MemberlistMembers ()
 Synchronous [exception] Synchronous version of listMembers(ListMembersDelegatePtr) , and throws an exception, ListMembersException, in case of a failed call.
See listMembers(ListMembersDelegatePtr) More...
 
cbe::util::Optional< std::vector< cbe::Member > > listMembers (ListMembersError &error)
 Synchronous [non-throwing] Synchronous version of listMembers(ListMembersDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See listMembers(ListMembersDelegatePtr) More...
 
void addRoleMember (MemberId memberId, AddRoleMemberDelegatePtr delegate)
 Adds a member to this role. More...
 
MemberId addRoleMember (MemberId memberId)
 Synchronous [exception] Synchronous version of AddRoleMember(MemberId, AddRoleMemberDelegatePtr) , and throws an exception, AddRoleMemberException, in case of a failed call.
See AddRoleMember(AddRoleMemberDelegatePtr) More...
 
cbe::util::Optional< MemberIdaddRoleMember (MemberId memberId, AddRoleMemberError &error)
 Synchronous [non-throwing] Synchronous version of AddRoleMember(memberId, AddRoleMemberDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See AddRoleMember(memberId, AddRoleMemberDelegatePtr) More...
 
void removeRoleMember (MemberId memberId, RemoveRoleMemberDelegatePtr delegate)
 Removes a member to this role. More...
 
MemberId removeRoleMember (MemberId memberId)
 Synchronous [exception] Synchronous version of RemoveRoleMember(MemberId memberId, RemoveRoleMemberDelegatePtr) , and throws an exception, RemoveRoleMemberException, in case of a failed call.
See RemoveRoleMember(RemoveRoleMemberDelegatePtr) More...
 
cbe::util::Optional< MemberIdremoveRoleMember (MemberId memberId, RemoveRoleMemberError &error)
 Synchronous [non-throwing] Synchronous version of RemoveRoleMember(memberId,RemoveRoleMemberDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See RemoveRoleMember(memberId, RemoveRoleMemberDelegatePtr) More...
 
 Role (cbe::DefaultCtor)
 Default constructor. More...
 
 operator bool () const
 Checks if the current instance is real. More...
 

Friends

class Group
 

Detailed Description

User role information.

Member Typedef Documentation

◆ ListMembersDelegatePtr

Pointer to cbe::delegate::ListMembersDelegate that is passed into asynchronous version of method listMembers()

◆ ListMembersException

Pointer to cbe::delegate::ListMembersDelegate that is passed into asynchronous version of method listMembers() See delegate::object::ListMembersDelegate::Exception

◆ ListMembersError

Forms the type of the error return parameter for the synchronous version of method listMembers()
See delegate::ListMembersDelegate::ErrorInfo

◆ AddRoleMemberDelegatePtr

Pointer to AddRoleMemberDelegate that is passed into:

  • cbe::Group::AddRoleMember(AddRoleMemberDelegatePtr).

◆ AddRoleMemberException

Pointer to cbe::delegate::AddRoleMemberDelegate that is passed into asynchronous version of method AddRoleMember() See delegate::object::AddRoleMemberDelegate::Exception

◆ AddRoleMemberError

Forms the type of the error return parameter for the synchronous version of method AddRoleMember()
See delegate::AddRoleMemberDelegate::ErrorInfo

◆ RemoveRoleMemberDelegatePtr

Pointer to RemoveRoleMember that is passed into:
Group::RemoveRoleMember(std::string, RemoveRoleMemberDelegatePtr).

◆ RemoveRoleMemberException

Pointer to cbe::delegate::RemoveRoleMember that is passed into asynchronous version of method RemoveRoleMember() See delegate::object::RemoveRoleMember::Exception

◆ RemoveRoleMemberError

Forms the type of the error return parameter for the synchronous version of method RemoveRoleMember()
See delegate::RemoveRoleMember::ErrorInfo

Constructor & Destructor Documentation

◆ Role()

cbe::Role::Role ( cbe::DefaultCtor  )

Default constructor.

Construct a new object with the DefaultCtor to enable the operator bool() test

Member Function Documentation

◆ name()

std::string cbe::Role::name ( ) const

Name of the role.

◆ id()

cbe::RoleId cbe::Role::id ( ) const

Id of the role.

◆ groupId()

cbe::GroupId cbe::Role::groupId ( ) const

Id of the group the role belongs to.

◆ listMembers() [1/3]

void cbe::Role::listMembers ( ListMembersDelegatePtr  delegate)

Lists the members of this role,.

Parameters
delegatePointer to a delegate::ListMembersDelegate instance that is implemented by the user.

◆ listMembers() [2/3]

std::vector<cbe::Member> cbe::Role::listMembers ( )

Synchronous [exception] Synchronous version of listMembers(ListMembersDelegatePtr) , and throws an exception, ListMembersException, in case of a failed call.
See listMembers(ListMembersDelegatePtr)

Returns
Information about the listMembers object — if the call was successful.
See cbe::delegate::ListMembersSuccess
Exceptions
ListMembersException

◆ listMembers() [3/3]

cbe::util::Optional<std::vector<cbe::Member> > cbe::Role::listMembers ( ListMembersError error)

Synchronous [non-throwing] Synchronous version of listMembers(ListMembersDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See listMembers(ListMembersDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the ListMembersError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ addRoleMember() [1/3]

void cbe::Role::addRoleMember ( MemberId  memberId,
AddRoleMemberDelegatePtr  delegate 
)

Adds a member to this role.

Parameters
memberIdThe id of the member to add to the role.
delegatePointer to a delegate::AddRoleMemberDelegate instance that is implemented by the user.

◆ addRoleMember() [2/3]

MemberId cbe::Role::addRoleMember ( MemberId  memberId)

Synchronous [exception] Synchronous version of AddRoleMember(MemberId, AddRoleMemberDelegatePtr) , and throws an exception, AddRoleMemberException, in case of a failed call.
See AddRoleMember(AddRoleMemberDelegatePtr)

Returns
Information about the AddRoleMember object — if the call was successful.
See cbe::delegate::AddRoleMemberDelegate::Success
Exceptions
AddRoleMemberException

◆ addRoleMember() [3/3]

cbe::util::Optional<MemberId> cbe::Role::addRoleMember ( MemberId  memberId,
AddRoleMemberError error 
)

Synchronous [non-throwing] Synchronous version of AddRoleMember(memberId, AddRoleMemberDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See AddRoleMember(memberId, AddRoleMemberDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the AddRoleMemberError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ removeRoleMember() [1/3]

void cbe::Role::removeRoleMember ( MemberId  memberId,
RemoveRoleMemberDelegatePtr  delegate 
)

Removes a member to this role.

Parameters
memberIdThe id of the member to remove from the role.
delegatePointer to a delegate::RemoveRoleMember instance that is implemented by the user.

◆ removeRoleMember() [2/3]

MemberId cbe::Role::removeRoleMember ( MemberId  memberId)

Synchronous [exception] Synchronous version of RemoveRoleMember(MemberId memberId, RemoveRoleMemberDelegatePtr) , and throws an exception, RemoveRoleMemberException, in case of a failed call.
See RemoveRoleMember(RemoveRoleMemberDelegatePtr)

Returns
Information about the RemoveRoleMember object — if the call was successful.
See cbe::delegate::RemoveRoleMember::Success
Exceptions
RemoveRoleMemberException

◆ removeRoleMember() [3/3]

cbe::util::Optional<MemberId> cbe::Role::removeRoleMember ( MemberId  memberId,
RemoveRoleMemberError error 
)

Synchronous [non-throwing] Synchronous version of RemoveRoleMember(memberId,RemoveRoleMemberDelegatePtr) , and throws no exception on error, instead the out/return parameter error is used to provide the error information in connection with a failed call.
See RemoveRoleMember(memberId, RemoveRoleMemberDelegatePtr)

Parameters
[out]errorReturn parameter containing the error information in case of a failed call.
An empty return value will indicate failure, and the RemoveRoleMemberError object passed in will we be populated with the error information.
Returns
Empty — i.e., false — indicates a failed call, and the error information is passed out via the error out/return parameter.

◆ operator bool()

cbe::Role::operator bool ( ) const
explicit

Checks if the current instance is real.

An "unreal" instance implies typically a failed event.

Relies on the Default constructor Role(cbe::DefaultCtor)

Returns
true : is real
false : unreal; got nullptr; if current instance is unbound/undefined. I.e., if it is only default constructed.

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