![]() |
SDK
2.1.4 [async]
CloudBackend Software Development Kit - SDK API for C++
|
A group of members. More...
#include <Group.h>
Public Types | |
using | Requests = std::vector< cbe::Request > |
using | CreateGroupDelegatePtr = delegate::CreateGroupDelegatePtr |
using | JoinDelegatePtr = delegate::group::JoinDelegatePtr |
using | LeaveDelegatePtr = delegate::LeaveDelegatePtr |
using | RemoveDelegatePtr = delegate::group::RemoveDelegatePtr |
using | RenameDelegatePtr = delegate::group::RenameDelegatePtr |
using | ListMembersDelegatePtr = delegate::ListMembersDelegatePtr |
using | ListBannedMembersDelegatePtr = delegate::ListMembersDelegatePtr |
using | ListRolesDelegatePtr = delegate::ListRolesDelegatePtr |
using | CreateRoleDelegatePtr = delegate::CreateRoleDelegatePtr |
using | RemoveRoleDelegatePtr = delegate::RemoveRoleDelegatePtr |
Public Member Functions | |
std::string | name () const |
cbe::GroupId | id () const |
cbe::GroupId | parentId () const |
cbe::Container | groupContainer () const |
cbe::Visibility | getVisibility () const |
bool | joined () const |
Requests | requests () const |
cbe::Group | createGroup (std::string name, std::string memberAlias, cbe::Visibility visibility, CreateGroupDelegatePtr delegate) |
Create a new Group. More... | |
void | join (std::string alias, cbe::Visibility memberVisibility, std::string applicationComment, JoinDelegatePtr delegate) |
Synchronous [exception] Ask to join a group. In this first version All members will be Public, meaning visible for other member inside the group. All groups will also be open so all join requests should be accepted directly. More... | |
void | leave (LeaveDelegatePtr delegate) |
Leave group. More... | |
void | remove (RemoveDelegatePtr delegate) |
Remove group. More... | |
void | rename (std::string newName, RenameDelegatePtr delegate) |
Rename the Group; group id does not change. More... | |
void | listMembers (ListMembersDelegatePtr delegate) |
List all members in the group. More... | |
void | listBannedMembers (ListBannedMembersDelegatePtr delegate) |
Lists all banned former members, or users. More... | |
void | listRoles (ListRolesDelegatePtr delegate) |
Lists all roles in the group. More... | |
void | createRole (std::string name, CreateRoleDelegatePtr delegate) |
Creates a new role in the group. More... | |
void | removeRole (RoleId roleId, RemoveRoleDelegatePtr delegate) |
Group (cbe::DefaultCtor) | |
Default constructor. More... | |
operator bool () const | |
Checks if the current instance is real. More... | |
Friends | |
class | GroupManager |
class | GroupQueryResult |
A group of members.
Pointer to CreateGroupDelegate that is passed into:
Group::createGroup(std::string,std::string,CreateGroupDelegatePtr,cbe::Visibility).
Pointer to cbe::delegate::CreateRoleDelegate that is passed into asynchronous version of method createRole()
Pointer to cbe::delegate::group::JoinDelegate that is passed into asynchronous version of method join()
Pointer to cbe::delegate::LeaveDelegate that is passed into asynchronous version of method leave()
Pointer to cbe::delegate::ListMembersDelegate that is passed into asynchronous version of method listBannedMembers()
Pointer to cbe::delegate::ListMembersDelegate that is passed into asynchronous version of method listMembers()
Pointer to cbe::delegate::ListRolesDelegate that is passed into asynchronous version of method listRoles()
Pointer to cbe::delegate::RemoveDelegate that is passed into asynchronous version of method remove()
Pointer to cbe::delegate::RemoveRoleDelegate that is passed into asynchronous version of method removeRole()
Pointer to cbe::delegate::RenameDelegate that is passed into asynchronous version of method rename()
cbe::Group::Group | ( | cbe::DefaultCtor | ) |
Default constructor.
Construct a new object with the DefaultCtor
to enable the operator bool() test
cbe::Group cbe::Group::createGroup | ( | std::string | name, |
std::string | memberAlias, | ||
cbe::Visibility | visibility, | ||
CreateGroupDelegatePtr | delegate | ||
) |
Create a new Group.
name | of the group |
memberAlias | another popular name |
delegate | Pointer to a delegate::CreateGroupDelegate instance that is implemented by the user. |
visibility | default: public |
void cbe::Group::createRole | ( | std::string | name, |
CreateRoleDelegatePtr | delegate | ||
) |
Creates a new role in the group.
name | The name of the role. |
delegate | Pointer to a delegate::CreateRoleDelegate instance that is implemented by the user. |
cbe::Visibility cbe::Group::getVisibility | ( | ) | const |
Visibility of the Group, Public is searchable and Private is not. In this early version you can create Private groups but the ability to invite has been blocked. (work in progress)
cbe::Container cbe::Group::groupContainer | ( | ) | const |
Every group has a drive/container where resources can be shared with the members of the group. Works like a shared container.
cbe::GroupId cbe::Group::id | ( | ) | const |
Returns the id number of the group.
void cbe::Group::join | ( | std::string | alias, |
cbe::Visibility | memberVisibility, | ||
std::string | applicationComment, | ||
JoinDelegatePtr | delegate | ||
) |
Synchronous [exception] Ask to join a group. In this first version All members will be Public, meaning visible for other member inside the group. All groups will also be open so all join requests should be accepted directly.
alias | name |
delegate | Pointer to a delegate::group::JoinDelegate instance that is implemented by the user. |
memberVisibility | default: public |
applicationComment | message to the owner regarding the application to join |
bool cbe::Group::joined | ( | ) | const |
Searched groups are obtained through the GroupQuery response. This list of groups have non-joined and joined groups. Already joined groups can be found on the groupManager.groups()
and they are also cached. The joined bool is used to easily sort out groups in the GroupQuery.
void cbe::Group::leave | ( | LeaveDelegatePtr | delegate | ) |
Leave group.
delegate | Pointer to a delegate::LeaveDelegate instance that is implemented by the user. |
void cbe::Group::listBannedMembers | ( | ListBannedMembersDelegatePtr | delegate | ) |
Lists all banned former members, or users.
delegate | Pointer to a delegate::ListMembersDelegate instance that is implemented by the user. |
void cbe::Group::listMembers | ( | ListMembersDelegatePtr | delegate | ) |
List all members in the group.
The member list is then retrieved via the delegate callback function cbe::delegate::ListMembersDelegate::onListMembersSuccess()
delegate | Pointer to a delegate::ListMembersDelegate instance that is implemented by the user. |
void cbe::Group::listRoles | ( | ListRolesDelegatePtr | delegate | ) |
Lists all roles in the group.
delegate | Pointer to a delegate::ListRolesDelegate instance that is implemented by the user. |
std::string cbe::Group::name | ( | ) | const |
Returns the name of the group.
|
explicit |
Checks if the current instance is real.
An "unreal" instance implies typically a failed event.
Relies on the Default
constructor
Group(cbe::DefaultCtor)
true
: is real false
: unreal; got nullptr; if current instance is unbound/undefined. I.e., if it is only default constructed. cbe::GroupId cbe::Group::parentId | ( | ) | const |
Group's Parent id number.
void cbe::Group::remove | ( | RemoveDelegatePtr | delegate | ) |
Remove group.
delegate | Pointer to a delegate::group::RemoveDelegate instance that is implemented by the user. |
void cbe::Group::removeRole | ( | RoleId | roleId, |
RemoveRoleDelegatePtr | delegate | ||
) |
@brief Removes a role in the group. @param roleId The id of the role to remove. @param delegate Pointer to a delegate::RemoveRoleDelegate instance
that is implemented by the user.
void cbe::Group::rename | ( | std::string | newName, |
RenameDelegatePtr | delegate | ||
) |
Rename the Group; group id does not change.
newName | the new name for the group |
delegate | Pointer to a delegate::group::RenameDelegate instance that is implemented by the user. |
Requests cbe::Group::requests | ( | ) | const |
Requests to join the group. To retrieve the list call listJoinRequests(cbe::GroupDelegatePtr delegate) on the group object.