Rogue Wave 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 ()
 Locks the entity. More...
 
IlsBoolean trylock ()
 Tries to lock the entity. More...
 
IlsBoolean unlock ()
 Unlocks the entity. More...
 
- Public Member Functions inherited from IlsEntity
 IlsEntity (IlsIdentifier id, IlsActivity activity=IlsModel::GetDefaultActivity())
 
 IlsEntity (IlsEntity &rhs)
 Copy constructor. The identifier is copied as well.
 
virtual ~IlsEntity ()
 Virtual destructor.
 
IlsActivity getActivity () const
 Returns ILS_ACTIVE if the entity has been set as active. Otherwise, it returns ILS_INACTIVE. More...
 
virtual IlsString getKeyIdentifier () const
 This virtual member function is used in subclasses of IlsViewed (see the IlsDynObject class). By default, it returns a null string.
 
virtual void cut (ILS_CUT_DIRECTIVE=ILS_ALL)
 Cuts all the relations of which the entity is the target. More...
 
IlsIdentifier getIdentifier () const
 Returns the identifier stored in the class IlsEntity. Thus, you do not have to store this identifier in the derived type.
 
void rename (IlsIdentifier)
 Renames the identifier stored in the class IlsEntity. This function automatically maintains consistency in the dictionary containing the entity. More...
 
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 ()
 Overrides the function IlsViewed::remove(). More...
 
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...
 
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

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

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

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.


© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.