Anope IRC Services  Version 2.0
Public Member Functions | Data Fields
ModeLocksImpl Struct Reference
Inheritance diagram for ModeLocksImpl:
Inheritance graph
[legend]
Collaboration diagram for ModeLocksImpl:
Collaboration graph
[legend]

Public Member Functions

 ModeLocksImpl (Extensible *obj)
 
 ~ModeLocksImpl ()
 
bool HasMLock (ChannelMode *mode, const Anope::string &param, bool status) const anope_override
 
bool SetMLock (ChannelMode *mode, bool status, const Anope::string &param, Anope::string setter, time_t created=Anope::CurTime) anope_override
 
bool RemoveMLock (ChannelMode *mode, bool status, const Anope::string &param="") anope_override
 
void RemoveMLock (ModeLock *mlock) anope_override
 
void ClearMLock () anope_override
 
const ModeListGetMLock () const anope_override
 
std::list< ModeLock * > GetModeLockList (const Anope::string &name) anope_override
 
const ModeLockGetMLock (const Anope::string &mname, const Anope::string &param="") anope_override
 
Anope::string GetMLockAsString (bool complete) const anope_override
 
void Check () anope_override
 
- Public Member Functions inherited from ModeLocks
virtual ~ModeLocks ()
 

Data Fields

Serialize::Reference< ChannelInfoci
 
Serialize::Checker< ModeListmlocks
 

Additional Inherited Members

- Public Types inherited from ModeLocks
typedef std::vector< ModeLock * > ModeList
 

Detailed Description

Definition at line 36 of file cs_mode.cpp.

Constructor & Destructor Documentation

ModeLocksImpl::ModeLocksImpl ( Extensible obj)
inline

Definition at line 41 of file cs_mode.cpp.

ModeLocksImpl::~ModeLocksImpl ( )
inline

Definition at line 45 of file cs_mode.cpp.

Member Function Documentation

void ModeLocksImpl::Check ( )
inlinevirtual

Implements ModeLocks.

Definition at line 204 of file cs_mode.cpp.

References Extensible::Shrink().

void ModeLocksImpl::ClearMLock ( )
inlinevirtual

Clear all mlocks on the channel

Implements ModeLocks.

Definition at line 137 of file cs_mode.cpp.

const ModeList& ModeLocksImpl::GetMLock ( ) const
inlinevirtual

Get all of the mlocks for this channel

Returns
The mlocks

Implements ModeLocks.

Definition at line 145 of file cs_mode.cpp.

References mlocks.

const ModeLock* ModeLocksImpl::GetMLock ( const Anope::string mname,
const Anope::string param = "" 
)
inlinevirtual

Get details for a specific mlock

Parameters
mnameThe mode name
Anoptional param to match with
Returns
The MLock, if any

Implements ModeLocks.

Definition at line 162 of file cs_mode.cpp.

References ModeLock::name, and ModeLock::param.

Anope::string ModeLocksImpl::GetMLockAsString ( bool  complete) const
inlinevirtual

Get the current mode locks as a string

Parameters
completeTrue to show mlock parameters aswell
Returns
A string of mode locks, eg: +nrt

Implements ModeLocks.

Definition at line 175 of file cs_mode.cpp.

References Anope::string::clear(), Anope::string::empty(), ModeManager::FindChannelModeByName(), Anope::string::length(), Mode::mchar, MODE_LIST, MODE_PARAM, MODE_STATUS, ModeLock::name, ModeLock::param, ModeLock::set, and Mode::type.

std::list<ModeLock *> ModeLocksImpl::GetModeLockList ( const Anope::string name)
inlinevirtual

Get a list of mode locks on a channel

Parameters
nameThe mode name to get a list of
Returns
a list of mlocks for the given mode

Implements ModeLocks.

Definition at line 150 of file cs_mode.cpp.

References ModeLock::name, and name.

bool ModeLocksImpl::HasMLock ( ChannelMode mode,
const Anope::string param,
bool  status 
) const
inlinevirtual

Check if a mode is mlocked

Parameters
modeThe mode
Anoptional param
statusTrue to check mlock on, false for mlock off
Returns
true on success, false on fail

Implements ModeLocks.

Definition at line 55 of file cs_mode.cpp.

References ModeLock::name, ModeLock::param, and ModeLock::set.

bool ModeLocksImpl::RemoveMLock ( ChannelMode mode,
bool  status,
const Anope::string param = "" 
)
inlinevirtual

Remove a mlock

Parameters
modeThe mode
statusTrue for mlock on, false for mlock off
paramThe param of the mode, required if it is a list or status mode
Returns
true on success, false on failure

Implements ModeLocks.

Definition at line 101 of file cs_mode.cpp.

References EVENT_STOP, FOREACH_RESULT, MODE_LIST, MODE_STATUS, ModeLock::name, Mode::name, ModeLock::param, and Mode::type.

Referenced by SetMLock().

void ModeLocksImpl::RemoveMLock ( ModeLock mlock)
inlinevirtual

Implements ModeLocks.

Definition at line 130 of file cs_mode.cpp.

bool ModeLocksImpl::SetMLock ( ChannelMode mode,
bool  status,
const Anope::string param,
Anope::string  setter,
time_t  created = Anope::CurTime 
)
inlinevirtual

Set a mlock

Parameters
modeThe mode
statusTrue for mlock on, false for mlock off
paramAn optional param arg for + mlocked modes
setterWho is setting the mlock
createdWhen the mlock was created
Returns
true on success, false on failure (module blocking)

Implements ModeLocks.

Definition at line 71 of file cs_mode.cpp.

References ModeLock::ci, ModeLock::created, NickCore::display, Anope::string::empty(), EVENT_STOP, FOREACH_RESULT, ChannelInfo::GetFounder(), ModeLock::name, Mode::name, ChannelInfo::name, ModeLock::param, RemoveMLock(), ModeLock::set, and ModeLock::setter.

Field Documentation

Serialize::Reference<ChannelInfo> ModeLocksImpl::ci

Definition at line 38 of file cs_mode.cpp.

Serialize::Checker<ModeList> ModeLocksImpl::mlocks

Definition at line 39 of file cs_mode.cpp.

Referenced by GetMLock().


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