Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Member Functions
IlsLockableEntity Class Reference

API FOR ADVANCED USERS – This class is used with multithreaded applications. It lets you lock an entity once within a thread. More...

#include <ilserver/model.h>

Inheritance diagram for IlsLockableEntity:
IlsEntity

Public Member Functions

IlsBoolean lock ()
 
IlsBoolean trylock ()
 
IlsBoolean unlock ()
 
- Public Member Functions inherited from IlsEntity
 IlsEntity (IlsEntity &rhs)
 Copy constructor. The identifier is copied as well.
 
 IlsEntity (IlsIdentifier id, IlsActivity activity=IlsModel::GetDefaultActivity())
 
virtual ~IlsEntity ()
 Virtual destructor.
 
IlsActivity getActivity () const
 
virtual void cut (ILS_CUT_DIRECTIVE=ILS_ALL)
 
IlsIdentifier getIdentifier () const
 
virtual IlsString getKeyIdentifier () const
 
IlsEntitygetEntity ()
 
void rename (IlsIdentifier)
 
void setEntityContext (IlsEntityContext &)
 
void unsetEntityContext (IlsEntityContext &)
 
IlsBoolean isIdentifierModified ()
 During a notification phase, this member function returns IlsTrue if the entity identifier has been modified since the last notification phase.
 
IlsIdentifier getOldIdentifier ()
 During a notification phase, this member function returns the old identifier of the entity. It returns a null smart pointer if the entity has not been modified since the last notification phase.
 
IlsBoolean remove ()
 
IlsBoolean areUsersModified ()
 During a notification phase, this function returns IlsTrue if a use relation has been added or removed since the last notification phase. More...
 
void onRmFromDictionary ()
 During a notification phase, this member function returns IlsTrue if the entity identifier has been modified since the last notification phase.
 
void removeFromDictionaries ()
 During a notification phase, this member function returns IlsTrue if the entity identifier has been modified since the last notification phase.
 
virtual IlsBoolean isUpdateAllowed ()
 By default, this virtual member function returns IlsFalse when the entity is locked and IlsTrue if you have the right to modify the entity. It is called if the static member function IlsModel::SetUpdateChecked() returns IlsTrue.
 

Detailed Description

API FOR ADVANCED USERS – This class is used with multithreaded applications. It lets you lock an entity once within a thread.

Library: server

This type of lock is riskier than the type of lock defined using IlsSafelyLockableEntity but offers better performance.

See also
IlsSafelyLockableEntity, IlsThread.

Member Function Documentation

◆ lock()

IlsBoolean IlsLockableEntity::lock ( )
virtual
\short Locks the entity.

If the entity is locked by another thread, it will wait until the lock can be taken. The member function returns IlsFalse if the operation fails.

An entity cannot be locked several times by the same thread.

Reimplemented from IlsEntity.

◆ trylock()

IlsBoolean IlsLockableEntity::trylock ( )
virtual
\short Tries to lock the entity. It returns \c

IlsFalse if the lock cannot be taken.

Unlike the member function lock() above, it does not wait until the operation becomes possible.

Reimplemented from IlsEntity.

◆ unlock()

IlsBoolean IlsLockableEntity::unlock ( )
virtual
\short Unlocks the entity.

An entity can be unlocked:

  • Only by the thread that locked it
  • Only if it has been locked first.

This function returns IlsFalse if an error occurs.

Reimplemented from IlsEntity.