CONZEPT 16 C++ API
C16::Records Class Referenceabstract

Generic record set. More...

#include "C16/Records.hpp"

Inheritance diagram for C16::Records:
C16::RecordsKey C16::RecordsLink C16::RecordsSelection

Detailed Description

Generic record set.

Examples

Iteration

#include "C16/Library.hpp"
using namespace C16;
void records_iterate(Records& records)
{
for
(
Result result = records.read(Place::FIRST);
result < Result::NO_REC;
result = records.read(Place::NEXT)
)
{
...
}
}

Public Member Functions

const Tabletable () const
 Gets the table of the record set. More...
 
const Recordrecord () const
 Gets the record buffer of the record set. More...
 
Recordrecord ()
 Gets the record buffer of the record set. More...
 
bool reverse () const
 Gets if the order of the records is reverted. More...
 
void reverse_set (bool reverse)
 Sets if the order of the records is reverted. More...
 
virtual long int count () const =0
 Gets the count of records of the record set. More...
 
Result read (Place place, Locking locking=Locking::NONE, bool reverse=false)
 Reads a record by means of a place into the record buffer. More...
 
Result read (long int position, Locking locking=Locking::NONE, bool reverse=false)
 Reads a record by means of its position into the record buffer. More...
 

Member Function Documentation

◆ table()

const Table& C16::Records::table ( ) const

Gets the table of the record set.

◆ record() [1/2]

const Record& C16::Records::record ( ) const

Gets the record buffer of the record set.

◆ record() [2/2]

Record& C16::Records::record ( )

Gets the record buffer of the record set.

◆ reverse()

bool C16::Records::reverse ( ) const

Gets if the order of the records is reverted.

◆ reverse_set()

void C16::Records::reverse_set ( bool  reverse)

Sets if the order of the records is reverted.

Parameters
reverseOption to reverse the order of the records

◆ count()

virtual long int C16::Records::count ( ) const
pure virtual

Gets the count of records of the record set.

Implemented in C16::RecordsLink, C16::RecordsKey, and C16::RecordsSelection.

◆ read() [1/2]

Result C16::Records::read ( Place  place,
Locking  locking = Locking::NONE,
bool  reverse = false 
)

Reads a record by means of a place into the record buffer.

Parameters
placePlace of the record
Place::FIRSTReads the first record of the record set.
Place::LASTReads the last record of the record set.
Place::NEXTReads the record following the record identified by the key value of the record buffer.
Place::PREVIOUSReads the record preceding the record identified by the key value of the record buffer.
lockingLocking to apply to the record
Locking::NONEDoes not change the lock of the record.
Locking::LOCK_EXCLUSIVEApplies an exclusive lock to the record.
Locking::LOCK_SINGLEApplies an exclusive, singulary lock to the record.
Locking::LOCK_FORCERemoves all locks by all users from the record and applies an exclusive lock to the record.
Locking::LOCK_SHAREDApplies a shared lock to the record.
Locking::UNLOCKRemoves a lock applied by the accessing user from the record.
reverseOption to use reverse order of the records
Returns
Result
Return values
Result::OKRecord loaded and locking applied.
Result::LOCKEDRecord loaded but already locked.
Result::NO_RECRecord inexistent.
Result::NO_LOCKSelection not locked.
Result::NO_RIGHTSPermissions insufficient.
Exceptions
Exception::InvalidityPlace invalid.
Exception::InvalidityLocking invalid.

◆ read() [2/2]

Result C16::Records::read ( long int  position,
Locking  locking = Locking::NONE,
bool  reverse = false 
)

Reads a record by means of its position into the record buffer.

Parameters
positionPosition of the record (1 to count())
lockingLocking to apply to the record
Locking::NONEDoes not change the lock of the record.
Locking::LOCK_EXCLUSIVEApplies an exclusive lock to the record.
Locking::LOCK_SINGLEApplies an exclusive, singulary lock to the record.
Locking::LOCK_FORCERemoves all locks by all users from the record and applies an exclusive lock to the record.
Locking::LOCK_SHAREDApplies a shared lock to the record.
Locking::UNLOCKRemoves a lock applied by the accessing user from the record.
reverseOption to use reverse order of the records
Returns
Result
Return values
Result::OKRecord loaded and locking applied.
Result::LOCKEDRecord loaded but already locked.
Result::NO_RECRecord inexistent.
Result::NO_RIGHTSPermissions insufficient.
Exceptions
Exception::InvalidityLocking invalid.
C16::Records
Generic record set.
Definition: Records.hpp:43
C16::Records::read
Result read(Place place, Locking locking=Locking::NONE, bool reverse=false)
Reads a record by means of a place into the record buffer.
C16::Place::NEXT
@ NEXT
Operate on the next entity.
C16::Place::FIRST
@ FIRST
Operate on the first entity.
Library.hpp
CONZEPT 16 C++ API.
C16::Result
Result
Result of an operation related to a database entity.
Definition: Result.hpp:12
C16
Namespace.
Definition: Array.hpp:6
C16::Result::NO_REC
@ NO_REC
Entity inexistent.