Server
API Reference Guide
Product Documentation:

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

API FOR ADVANCED USERS – This class is used with multithreaded applications. It lets you lock an entity several times in the same thread. More...

#include <ilserver/model.h>

Inheritance diagram for IlsSafelyLockableEntity:
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 several times in the same thread.

Library: server

See also
IlsLockableEntity, IlsSafelyLockableObject, IlsThread.

Member Function Documentation

◆ lock()

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

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

An entity can be locked several times provided that the number of calls to lock() equals the number of calls to unlock().

Reimplemented from IlsEntity.

◆ trylock()

IlsBoolean IlsSafelyLockableEntity::trylock ( )
virtual
\short Tries to lock the entity.

It returns IlsFalse if the lock cannot be taken. Unlike the function IlsSafelyLockableEntity::lock(), it does not wait until the operation becomes possible. Within a thread, you can lock an entity repeatedly.

Reimplemented from IlsEntity.

◆ unlock()

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

An entity can be unlocked only by the thread that locked it. An object can be unlocked only if it has been locked first. This function returns IlsFalse if an error occurs.

Reimplemented from IlsEntity.