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

Key of a table. More...

#include "C16/Key.hpp"

Detailed Description

Key of a table.

Classes

class  Field
 Field of a key. More...
 
class  Reorganization
 Reorganization of a key. More...
 

Public Member Functions

virtual Databasedatabase () const =0
 Gets the database of the key. More...
 
virtual const Tabletable () const =0
 Gets the table of the key. More...
 
virtual int number () const =0
 Gets the number of the key. More...
 
virtual const std::string & name () const =0
 Gets the name of the key. More...
 
virtual bool unique () const =0
 Gets if the key is unique. More...
 
virtual Reorganization::Result reorganize (const Reorganization::Callback &callback=Reorganization::Callback()) const
 Reorganizes the key. More...
 
virtual const Series< Field > & fields () const =0
 Gets the fields of the key. More...
 

Member Function Documentation

◆ database()

virtual Database& C16::Key::database ( ) const
pure virtual

Gets the database of the key.

◆ table()

virtual const Table& C16::Key::table ( ) const
pure virtual

Gets the table of the key.

◆ number()

virtual int C16::Key::number ( ) const
pure virtual

Gets the number of the key.

◆ name()

virtual const std::string& C16::Key::name ( ) const
pure virtual

Gets the name of the key.

◆ unique()

virtual bool C16::Key::unique ( ) const
pure virtual

Gets if the key is unique.

◆ reorganize()

virtual Reorganization::Result C16::Key::reorganize ( const Reorganization::Callback callback = Reorganization::Callback()) const
virtual

Reorganizes the key.

Parameters
callbackCallback that will be called in a loop during the reorganization
Returns
Result of the reorganization
Exceptions
Exception::UnavailabilityKey reorganization unavailable.
Key reorganization is unavailable for the origin database.
Note
Key reorganization is unavailable for the origin database.
Examples
#include "C16/Library.hpp"
using namespace C16;
void key_reorganize(const Key& key)
{
// Reorganize key.
// Reorganize key with callback.
result = key.reorganize(
[] (
long long int record_id_processed_last,
long int key_entries_processed,
long int records_defective,
long int key_entry_collisions,
bool& abort
) noexcept
{
...
if (...)
// Aborts the reorganization.
abort = true;
}
);
}

◆ fields()

virtual const Series<Field>& C16::Key::fields ( ) const
pure virtual

Gets the fields of the key.

Returns
Series of fields of the key
Examples
#include "C16/Library.hpp"
using namespace C16;
void key_fields_iterate(const Key& key)
{
// const-Iteration
for (const Key::Field& field : key.fields())
{
...
}
}
C16::Key::Field
Field of a key.
Definition: Key.hpp:174
C16::Key::fields
virtual const Series< Field > & fields() const =0
Gets the fields of the key.
C16::Key::Reorganization::Result
Result
Result of a reorganization of a key.
Definition: Key.hpp:78
C16::Key::reorganize
virtual Reorganization::Result reorganize(const Reorganization::Callback &callback=Reorganization::Callback()) const
Reorganizes the key.
C16::Key::Reorganization::Status
Status
Status of a reorganization of a key.
Definition: Key.hpp:65
Library.hpp
CONZEPT 16 C++ API.
C16::Key
Key of a table.
Definition: Key.hpp:17
C16
Namespace.
Definition: Array.hpp:6