Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes

Flags< T > Class Template Reference

#include <anope.h>

Collaboration diagram for Flags< T >:
Collaboration graph
[legend]

Public Member Functions

void SetFlag (T value)
void UnsetFlag (T value)
bool HasFlag (T value) const
size_t FlagCount () const
void ClearFlags ()
Anope::string ToString () const
void FromString (const Anope::string &str)
std::vector< Anope::stringToVector () const
void FromVector (const std::vector< Anope::string > &strings)

Static Public Member Functions

static const Anope::stringGetFlagStrings ()

Private Attributes

std::vector< bool > flags_values

Static Private Attributes

static const Anope::stringflags_strings

Detailed Description

template<typename T>
class Flags< T >

Class with the ability to keep flags on items, they should extend from this where T is an enum.

Definition at line 770 of file anope.h.


Member Function Documentation

template<typename T>
void Flags< T >::ClearFlags (  )  [inline]
template<typename T>
size_t Flags< T >::FlagCount (  )  const [inline]

Check how many flags are set

Returns:
The number of flags set

Definition at line 812 of file anope.h.

Referenced by Channel::HasUserStatus(), and DBPlain::OnSaveDatabase().

template<typename T>
void Flags< T >::FromString ( const Anope::string str  )  [inline]

Definition at line 843 of file anope.h.

Referenced by AutoKick::Unserialize(), and BotInfo::Unserialize().

template<typename T>
void Flags< T >::FromVector ( const std::vector< Anope::string > &  strings  )  [inline]

Definition at line 864 of file anope.h.

Referenced by Flags< ServerFlag >::FromString(), and OnDatabaseReadMetadata().

template<typename T>
static const Anope::string* Flags< T >::GetFlagStrings (  )  [inline, static]

Definition at line 828 of file anope.h.

Referenced by OnDatabaseReadMetadata().

template<typename T>
bool Flags< T >::HasFlag ( value  )  const [inline]

Check if this item has a flag

Parameters:
value The flag
Returns:
true or false

Definition at line 802 of file anope.h.

Referenced by CommandOSDNS::AddServer(), SocketEngine::Change(), ChannelInfo::ChannelInfo(), MyMemoServService::Check(), ChannelInfo::CheckKick(), CommandNSInfo::CheckOptStr(), CommandCSInfo::CheckOptStr(), CommandBSInfo::CheckOptStr(), CommandCSAKick::DoAdd(), CommandBSBot::DoChange(), CommandCSAKick::DoDel(), CommandBSBot::DoDel(), CommandMSSet::DoLimit(), DoneServices(), MemoListCallback::DoRead(), CommandCSEnforce::DoSecureOps(), CommandNSCert::DoServAdminList(), CommandOSNOOP::Execute(), CommandNSList::Execute(), CommandNSInfo::Execute(), CommandNSGList::Execute(), CommandNSAList::Execute(), CommandNSAccess::Execute(), CommandMSRead::Execute(), CommandMSList::Execute(), CommandMSInfo::Execute(), CommandMSCheck::Execute(), CommandMSCancel::Execute(), CommandCSUnSuspend::Execute(), CommandCSStatus::Execute(), CommandCSSetSuccessor::Execute(), CommandCSSetPersist::Execute(), CommandCSSetFounder::Execute(), CommandCSRegister::Execute(), CommandCSList::Execute(), CommandCSKick::Execute(), CommandCSInfo::Execute(), CommandCSDrop::Execute(), CommandCSClone::Execute(), CommandCSBan::Execute(), CommandBSInfo::Execute(), CommandBSBotList::Execute(), CommandBSUnassign::Execute(), CommandBSAssign::Execute(), SSLSocketIO::FinishAccept(), SocketIO::FinishConnect(), SSLSocketIO::FinishConnect(), MChanstats::GetDisplay(), User::GetModes(), User::HasMode(), Channel::HasUserStatus(), UnrealExtBan::Matches(), InspIRCdExtBan::Matches(), NickCore::NickCore(), Server::Notice(), OSDefcon::OnChannelModeSet(), OSDefcon::OnChannelModeUnset(), CSAKick::OnCheckKick(), ChanServCore::OnDelCore(), ModuleDNS::OnNewServer(), NSAJoin::OnNickIdentify(), BSKick::OnPrivmsg(), WebCPanel::NickServ::Alist::OnRequest(), WebCPanel::MemoServ::Memos::OnRequest(), WebCPanel::ChanServ::Set::OnRequest(), WebCPanel::ChanServ::Drop::OnRequest(), DBPlain::OnSaveDatabase(), NSRecoverRequest::OnSuccess(), MChanstats::OnTopicUpdated(), OSDefcon::ParseModeString(), SocketEngine::Process(), CommandCSAKick::ProcessList(), Channel::Reset(), IRCDMessageRSQuit::Run(), MyMemoServService::Send(), UnrealIRCdProto::SendJoin(), PlexusProto::SendJoin(), ngIRCdProto::SendJoin(), InspIRCd12Proto::SendJoin(), InspIRCdProto::SendJoin(), BahamutIRCdProto::SendJoin(), User::SendMessage(), IRCDProto::SendMessageInternal(), Server::Server(), MyGlobalService::ServerGlobal(), CommandCSTopic::Set(), Channel::SetCorrectModes(), ShouldHide(), Message::Join::SJoin(), Server::Sync(), ExpireCallback::Tick(), Flags< ServerFlag >::ToVector(), and UplinkSocket::Message::~Message().

template<typename T>
void Flags< T >::SetFlag ( value  )  [inline]

Add a flag to this item

Parameters:
value The flag

Definition at line 779 of file anope.h.

Referenced by SocketIO::Accept(), SSLSocketIO::Accept(), ChannelInfo::AddAkick(), SocketEngine::Change(), ChannelInfo::ChannelInfo(), User::Collide(), SocketIO::Connect(), SSLSocketIO::Connect(), CommandMSSet::DoLimit(), CommandMSSet::DoNotify(), CommandCSEnforce::DoSecureOps(), DoServices(), CommandNSSuspend::Execute(), CommandNSSASetNoexpire::Execute(), CommandNSRegister::Execute(), CommandMSRSend::Execute(), CommandCSSuspend::Execute(), CommandCSSASetNoexpire::Execute(), CommandCSSetSignKick::Execute(), CommandCSSetSecureOps::Execute(), CommandCSSetSecureFounder::Execute(), CommandCSSetSecure::Execute(), CommandCSSetRestricted::Execute(), CommandCSSetPrivate::Execute(), CommandCSSetPersist::Execute(), CommandCSSetPeace::Execute(), CommandCSSetKeepTopic::Execute(), CommandCSSetChanstats::Execute(), CommandCSSetAutoOp::Execute(), CommandCSRegister::Execute(), CommandCSClone::Execute(), CommandBSSetPrivate::Execute(), CommandBSSetNoBot::Execute(), CommandBSSetGreet::Execute(), CommandBSSetFantasy::Execute(), CommandBSSetDontKickVoices::Execute(), CommandBSSetDontKickOps::Execute(), CommandBSKick::Execute(), SSLSocketIO::FinishAccept(), SocketIO::FinishConnect(), SSLSocketIO::FinishConnect(), Flags< ServerFlag >::FromVector(), LoadBots(), LoadChannels(), LoadNicks(), CommandCSTopic::Lock(), OnDatabaseReadMetadata(), WebCPanel::MemoServ::Memos::OnRequest(), WebCPanel::ChanServ::Set::OnRequest(), OSDefcon::ParseModeString(), SocketEngine::Process(), CommandNSSetSecure::Run(), CommandNSSetPrivate::Run(), CommandNSSetMessage::Run(), CommandNSSetKill::Run(), CommandNSSetHide::Run(), CommandNSSetAutoOp::Run(), MyMemoServService::Send(), HybridProto::SendTopic(), ServerConfig::ServerConfig(), CommandCSTopic::Set(), User::SetModeInternal(), Channel::SetModeInternal(), Message::Join::SJoin(), ModuleProxyScan::ConnectionTimeout::Tick(), ModeManager::UpdateDefaultMLock(), and UplinkSocket::~UplinkSocket().

template<typename T>
Anope::string Flags< T >::ToString (  )  const [inline]

Definition at line 833 of file anope.h.

Referenced by DBPlain::OnSaveDatabase(), and ChannelInfo::Serialize().

template<typename T>
std::vector<Anope::string> Flags< T >::ToVector (  )  const [inline]

Definition at line 855 of file anope.h.

Referenced by Flags< ServerFlag >::ToString().

template<typename T>
void Flags< T >::UnsetFlag ( value  )  [inline]

Remove a flag from this item

Parameters:
value The flag

Definition at line 792 of file anope.h.

Referenced by SocketEngine::Change(), SocketIO::Connect(), SSLSocketIO::Connect(), CommandMSSet::DoLimit(), CommandMSSet::DoNotify(), MemoListCallback::DoRead(), CommandCSEnforce::DoSecureOps(), CommandNSSuspend::Execute(), CommandNSSASetNoexpire::Execute(), CommandNSConfirm::Execute(), CommandCSUnSuspend::Execute(), CommandCSSASetNoexpire::Execute(), CommandCSSetSignKick::Execute(), CommandCSSetSecureOps::Execute(), CommandCSSetSecureFounder::Execute(), CommandCSSetSecure::Execute(), CommandCSSetRestricted::Execute(), CommandCSSetPrivate::Execute(), CommandCSSetPersist::Execute(), CommandCSSetPeace::Execute(), CommandCSSetKeepTopic::Execute(), CommandCSSetChanstats::Execute(), CommandCSSetAutoOp::Execute(), CommandBSSetPrivate::Execute(), CommandBSSetNoBot::Execute(), CommandBSSetGreet::Execute(), CommandBSSetFantasy::Execute(), CommandBSSetDontKickVoices::Execute(), CommandBSSetDontKickOps::Execute(), CommandBSKick::Execute(), SSLSocketIO::FinishAccept(), SocketIO::FinishConnect(), SSLSocketIO::FinishConnect(), LoadChannels(), NSResetPass::OnPreCommand(), WebCPanel::MemoServ::Memos::OnRequest(), WebCPanel::ChanServ::Set::OnRequest(), OSDefcon::ParseModeString(), User::RemoveModeInternal(), Channel::RemoveModeInternal(), rsend_notify(), CommandNSSetSecure::Run(), CommandNSSetPrivate::Run(), CommandNSSetMessage::Run(), CommandNSSetKill::Run(), CommandNSSetHide::Run(), CommandNSSetAutoOp::Run(), CommandCSTopic::Set(), Message::Join::SJoin(), and CommandCSTopic::Unlock().


Field Documentation

template<typename T>
const Anope::string* Flags< T >::flags_strings [static, private]
template<typename T>
std::vector<bool> Flags< T >::flags_values [private]

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