8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
24#if ALIB_DEBUG && !DOXYGEN
25# if defined(__GNUC__) || defined(__clang__)
40# if defined( _WIN32 ) && !defined(_STRING_)
50#if (ALIB_SINGLE_THREADED && ALIB_EXT_LIB_THREADS_AVAILABLE)
159 { 6,
"ENUMRECORDS" },
162 { 8,
"EXPRESSIONS" },
167 { 13,
"SINGLETONS" },
171 { 16,
"THREADMODEL" },
174 { 19,
"ALIB_DEBUG_ARRAY_COMPRESSION" },
175 { 20,
"ALIB_DEBUG_ALLOCATIONS" },
176 { 21,
"ALIB_DEBUG_BOXING" },
177 { 22,
"ALIB_DEBUG_CONTAINERS" },
178 { 23,
"ALIB_DEBUG_CRITICAL_SECTIONS" },
180 { 24,
"ALIB_DEBUG_MEMORY" },
181 { 25,
"ALIB_DEBUG_STRINGS" },
182 { 26,
"ALIB_DEBUG_RESOURCES" },
183 { 27,
"ALIB_C20_MODULES" },
184 { 28,
"ALIB_SINGLE_THREADED" },
185 { 29,
"FEAT_SINGLETON_MAPPED" },
186 { 30,
"CHARACTERS_WIDE" },
187 { 31,
"CHARACTERS_WCHAR_IS_4" },
189 { 32,
"FEAT_BOXING_BIJECTIVE_INTEGRALS" },
190 { 33,
"FEAT_BOXING_BIJECTIVE_CHARACTERS" },
191 { 34,
"FEAT_BOXING_BIJECTIVE_FLOATS" },
192 { 35,
"ALIB_FEAT_BOOST_REGEX" },
194 { 37,
"DBG_LOG_CI" },
196 { 39,
"REL_LOG_CI" },
205 std::cerr <<
"!!! Error in ALox library compilation: linked against wrong version of ALib" << std::endl;
206 std::cerr <<
"!!! ALib library version: " <<
VERSION <<
"R" << int(
REVISION) << std::endl;
207 std::cerr <<
"!!! ALib requested version: " << alibVersion <<
"R" << alibRevision << std::endl;
208 std::cerr <<
"!!! Exiting with exit(-1)" << std::endl;
219 std::cerr <<
"!!! Error in ALib library compilation: linked library of ALib has "
220 "different compiler-symbols set than the using executable (or library)." << std::endl;
223 std::cerr << std::left << std::setw(35) <<
"Symbol" <<
'|' << std::setw(5) <<
" Lib" <<
'|' <<
" Comp. Unit" << std::endl;
224 std::cerr<< std::setw(62) << std::setfill(
'-') <<
' ' << std::endl << std::setfill(
' ');
229 bool reqFlag= (compilationFlags.
bits[p.Flag/8] & (1 << (p.Flag % 8))) != 0;
231 std::cerr << std::setw(35) << p.Name <<
'|' << std::setw(5) << (libFlag ?
" On" :
" Off")
232 <<
"|" << std::setw(5) << (reqFlag ?
" On" :
" Off")
233 << ( libFlag != reqFlag ?
" <-- Mismatch! " :
"")
238 std::cerr <<
"!!! Exiting with exit(-1)" << std::endl;
267 # if !ALIB_SINGLE_THREADED
269 # if ALIB_DEBUG_CRITICAL_SECTIONS && ALIB_MONOMEM
281DOX_MARKER([DOX_ENUMS_MULTIPLE_RECORDS])
295DOX_MARKER([DOX_ENUMS_MULTIPLE_RECORDS])
303DOX_MARKER([DOX_ENUMS_MULTIPLE_RECORDS_2])
312DOX_MARKER([DOX_ENUMS_MULTIPLE_RECORDS_2])
427#if !ALIB_SINGLE_THREADED
441 { system::SystemFolders::Root ,
A_CHAR(
"Root" ) , 1 },
442 { system::SystemFolders::Current ,
A_CHAR(
"Current" ) , 1 },
443 { system::SystemFolders::HomeConfig ,
A_CHAR(
"HomeConfig") , 5 },
444 { system::SystemFolders::Home ,
A_CHAR(
"Home" ) , 1 },
445 { system::SystemFolders::Module ,
A_CHAR(
"Module" ) , 1 },
446 { system::SystemFolders::Temp ,
A_CHAR(
"Temp" ) , 1 },
447 { system::SystemFolders::VarTemp ,
A_CHAR(
"VarTemp" ) , 1 },
467 { format::ByteSizeUnits::B ,
A_CHAR(
"B" ) , 3 },
468 { format::ByteSizeUnits::KiB ,
A_CHAR(
"KiB" ) , 3 },
469 { format::ByteSizeUnits::MiB ,
A_CHAR(
"MiB" ) , 3 },
470 { format::ByteSizeUnits::GiB ,
A_CHAR(
"GiB" ) , 3 },
471 { format::ByteSizeUnits::TiB ,
A_CHAR(
"TiB" ) , 3 },
472 { format::ByteSizeUnits::PiB ,
A_CHAR(
"PiB" ) , 3 },
473 { format::ByteSizeUnits::EiB ,
A_CHAR(
"EiB" ) , 3 },
474 { format::ByteSizeUnits::ZiB ,
A_CHAR(
"ZiB" ) , 3 },
475 { format::ByteSizeUnits::YiB ,
A_CHAR(
"YiB" ) , 3 },
476 { format::ByteSizeUnits::RiB ,
A_CHAR(
"RiB" ) , 3 },
477 { format::ByteSizeUnits::QiB ,
A_CHAR(
"QiB" ) , 3 },
478 { format::ByteSizeUnits::B ,
A_CHAR(
"B" ) , 1 },
479 { format::ByteSizeUnits::kB ,
A_CHAR(
"kB" ) , 2 },
480 { format::ByteSizeUnits::MB ,
A_CHAR(
"MB" ) , 2 },
481 { format::ByteSizeUnits::GB ,
A_CHAR(
"GB" ) , 2 },
482 { format::ByteSizeUnits::TB ,
A_CHAR(
"TB" ) , 2 },
483 { format::ByteSizeUnits::PB ,
A_CHAR(
"PB" ) , 2 },
484 { format::ByteSizeUnits::EB ,
A_CHAR(
"EB" ) , 2 },
485 { format::ByteSizeUnits::ZB ,
A_CHAR(
"ZB" ) , 2 },
486 { format::ByteSizeUnits::YB ,
A_CHAR(
"YB" ) , 2 },
487 { format::ByteSizeUnits::RB ,
A_CHAR(
"RB" ) , 2 },
488 { format::ByteSizeUnits::QB ,
A_CHAR(
"QB" ) , 2 },
495 "11,ArgumentIndexIs0," "Argument index 0 not allowed.\n"
496 "In: {!Q}\n >{!FillC-}^"
497 "," "12,ArgumentIndexOutOfBounds," "Argument index #{} is out of bounds. {} arguments are available.\n"
498 "In: {!Q}\n >{!FillC-}^"
499 "," "13,IncompatibleTypeCode," "Detected placeholder type does not match given argument.\n"
500 "Placeholder number: {}\n"
501 "Placeholder type: {} ({})"
502 "Placeholder type: {} ({})\n"
503 "Deduced argument type: {!Q}\n"
505 "In: {!Q}\n >{!FillC-}^"
507 "," "101,MissingClosingBracket," "Closing bracket '}}' of placeholder not found (or syntax error).\n"
508 "In: {!Q}\n >{!FillC-}^"
509 "," "102,MissingPrecisionValuePS," "Missing precision value after '.' character."
510 "\nIn: {!Q}\n >{!FillC-}^"
511 "," "103,DuplicateTypeCode," "Duplicate type code {!Q'} given (previous was {!Q'})."
513 "\nIn: {!Q}\n >{!FillC-}^"
514 "," "104,UnknownTypeCode," "Unknown type code {!Q'} given."
515 "\nIn: {!Q}\n >{!FillC-}^"
517 "," "105,ExclamationMarkExpected," "Expected '!' in continuation of placeholder."
519 "\nIn: {!Q}\n >{!FillC-}^"
520 "," "106,UnknownConversionPS," "Unknown conversion \"!{}\"."
522 "\nIn: {!Q}\n >{!FillC-}^"
523 "," "107,PrecisionSpecificationWithInteger," "Precision not allowed with integer format."
525 "\nIn: {!Q}\n >{!FillC-}^"
526 "," "108,MissingReplacementStrings," "Missing pair of replacement strings \"<src><repl>\" after \"!Replace\"."
528 "\nIn: {!Q}\n >{!FillC-}^"
530 "," "201,NegativeValuesInBracketsNotSupported," "Brackets for negative values not implemented/supported."
531 "\nIn: {!Q}\n >{!FillC-}^"
532 "," "202,MissingPrecisionValueJS," "Missing precision value after '.' character."
533 "\nIn: {!Q}\n >{!FillC-}^"
534 "," "203,HexadecimalFloatFormatNotSupported," "Hexadecimal float format not implemented/supported."
535 "\nIn: {!Q}\n >{!FillC-}^"
536 "," "204,NoAlternateFormOfConversion," "Alternate form '#' not supported with conversion {!Q}."
537 "\nIn: {!Q}\n >{!FillC-}^"
538 "," "205,NoPrecisionWithConversion," "Precision specification (\".{}\") is not supported with conversion {!Q}."
539 "\nIn: {!Q}\n >{!FillC-}^"
540 "," "206,UnknownDateTimeConversionSuffix," "Unknown date/time conversion suffix {!Q'}."
541 "\nIn: {!Q}\n >{!FillC-}^"
542 "," "207,UnknownConversionJS," "Unknown conversion character {!Q'}."
543 "\nIn: {!Q}\n >{!FillC-}^"
545 "," "501,UnknownPropertyInFormatString," "Unknown property identifier \"{}{}\" in format string.\n"
546 "Format string: {!Q}.\n"
547 "Allowed identifiers:"
548 "," "502,ErrorInResultingFormatString," "Error in resulting format string.\nSource format: {!Q}."
549 "," "510,MissingConfigurationVariable," "Missing or empty configuration variable {!Q} containing user-defined format string."
551 "," "601,UnknownMarker," "Unknown marker at position {}.\n"
552 " Marked text: {!Q}.\n"
554 "," "602,EndmarkerWithoutStart," "Found an end-marker without a start marker at position {}.\n"
555 " Marked text: {!Q}.\n"
563 { variables::Priority::NONE ,
A_CHAR(
"NONE" ) , 1 },
564 { variables::Priority::AutoDetected ,
A_CHAR(
"AutoDetected" ) , 1 },
565 { variables::Priority::DefaultValues ,
A_CHAR(
"DefaultValues") , 1 },
566 { variables::Priority::Standard ,
A_CHAR(
"Standard" ) , 1 },
567 { variables::Priority::ConfigFile ,
A_CHAR(
"ConfigFile" ) , 2 },
568 { variables::Priority::Environment ,
A_CHAR(
"Environment" ) , 1 },
569 { variables::Priority::SessionFile ,
A_CHAR(
"SessionFile" ) , 8 },
570 { variables::Priority::CLI ,
A_CHAR(
"CLI" ) , 2 },
571 { variables::Priority::Session ,
A_CHAR(
"Session" ) , 2 },
572 { variables::Priority::Protected ,
A_CHAR(
"Protected" ) , 1 },
592 { threadmodel::Priority::Lowest ,
A_CHAR(
"Lowest" ), 4 },
593 { threadmodel::Priority::DeferredDeletion,
A_CHAR(
"DeferredDeletion" ), 1 },
594 { threadmodel::Priority::Low ,
A_CHAR(
"Low" ), 1 },
595 { threadmodel::Priority::Standard ,
A_CHAR(
"Standard" ), 1 },
596 { threadmodel::Priority::Highest ,
A_CHAR(
"Highest" ), 5 },
597 { threadmodel::Priority::High ,
A_CHAR(
"High" ), 1 },
610DOX_MARKER([DOX_CRITICAL_SECTIONS_ADD_LOCK])
611#if ALIB_DEBUG_CRITICAL_SECTIONS && ALIB_MONOMEM
617DOX_MARKER([DOX_CRITICAL_SECTIONS_ADD_LOCK])
623 #if ALIB_DEBUG_CRITICAL_SECTIONS && ALIB_MONOMEM
680 if( targetCamp ==
nullptr )
681 targetCamp=
CAMPS.back();
694DOX_MARKER([DOX_CRITICAL_SECTIONS_ADD_LOCK2])
695#if ALIB_DEBUG_CRITICAL_SECTIONS && ALIB_MONOMEM
698DOX_MARKER([DOX_CRITICAL_SECTIONS_ADD_LOCK2])
704 auto targetCampIt=
CAMPS.rbegin();
705 while(targetCampIt !=
CAMPS.rend() &&
706 *targetCampIt != targetCamp )
710 "Target camp given to function alib::Bootstrap() is not included in list alib::CAMPS.\n"
716 phaseIntegral <=
int( targetPhase ) ;
740 auto& hashMap= lPool->BootstrapGetInternalHashMap();
741 hashMap.BaseLoadFactor( 2.0 );
742 hashMap.MaxLoadFactor ( 5.0 );
751 for(
auto campIt= targetCampIt ; campIt !=
CAMPS.rend() ; ++campIt ) {
752 if ( skipOne ) { skipOne=
false;
continue; }
755 if( (*campIt)->GetResourcePool() !=
nullptr
756 && (*campIt)->GetResourcePool() != actPool )
758 actPool= (*campIt)->GetResourcePool();
762 (*campIt)->BootstrapSetResourcePool( actPool );
772 if ( targetCamp->
GetConfig() ==
nullptr )
775 #if ALIB_DEBUG_CRITICAL_SECTIONS
776 targetCamp->
GetConfig()->NodeTable().dcs.DCSName=
"Camp.Config-bootstrap-created";
778 #if !ALIB_SINGLE_THREADED && ALIB_DEBUG
779 targetCamp->
GetConfig().
GetLock().Dbg.Name=
"Camp.Config.Lock-bootstrap-created";
786 for(
auto module= targetCampIt ;
module != CAMPS.rend() ; ++module )
788 if ( skipOne ) { skipOne=
false;
continue; }
791 if( (*module)->GetConfig() !=
nullptr && (*module)->GetConfig() != *actConfig)
792 actConfig = &(*module)->GetConfig();
794 (*module)->BootstrapSetConfig( *actConfig );
800 ALIB_DBG(
bool foundThisModuleInList =
false; )
804 if(
int(
camp->GetBootstrapState()) >=
int(actualPhase ) )
810 "With this invocation of Bootstrap() a camp skips a bootstrap phase.\n"
811 "Resource category of the target camp: ",
camp->ResourceCategory )
812 camp->BootstrapSetPhase(actualPhase);
816 if (
camp == targetCamp )
818 ALIB_DBG( foundThisModuleInList =
true );
823 "The target camp of function Bootstrap is not included in list alib::CAMPS "
824 "or was already bootstrapped for this phase!\n"
831 #if ALIB_DEBUG_CRITICAL_SECTIONS && ALIB_MONOMEM
840 #if ALIB_DEBUG_CRITICAL_SECTIONS && ALIB_MONOMEM
846 "Empty camp list on shutdown. Shutdown invoked twice?" )
847 if( targetCamp ==
nullptr )
848 targetCamp=
CAMPS.front();
853 auto targetCampIt=
CAMPS.begin();
854 while( targetCampIt !=
CAMPS.end()
855 && *targetCampIt != targetCamp )
858 "Target camp given to function alib::Shutdown() is not included in list alib::CAMPS.\n"
862 ALIB_DBG(
bool foundThisModuleInList=
false );
865 ; phaseIntegral<= int( targetPhase )
871 for(
auto campIt=
CAMPS.rbegin() ; campIt !=
CAMPS.rend() ; ++campIt )
875 "CAMPS",
"Trying to terminate a not (fully) initialized module. "
879 if (
int(( *campIt )->GetBootstrapState()) > -
int(actualPhase) )
883 ALIB_ASSERT_ERROR( (
int(( *campIt )->GetBootstrapState()) == 3 && phaseIntegral == 1 )
884 || (
int(( *campIt )->GetBootstrapState()) == -1 && phaseIntegral == 2 ),
885 "CAMPS",
"With this invocation of Bootstrap(), a camp skips a bootstrap phase \n"
886 "Resource category of the target camp: ", ( *campIt )->ResourceCategory )
889 ( *campIt )->Shutdown(actualPhase );
892 ALIB_DBG(
if(( *campIt ) == targetCamp )
893 foundThisModuleInList=
true; )
896 if(( *campIt ) == targetCamp )
901 "The target camp of function Shutdown is not included in list alib::CAMPS "
902 "or was already shutdown for this phase!\n"
906 #if ALIB_DEBUG_CRITICAL_SECTIONS
909 for(
auto campIt=
CAMPS.rbegin() ; campIt !=
CAMPS.rend() ; ++campIt )
910 (*campIt)->GetConfig()->NodeTable().dcs.DCSLock=
nullptr;
915 for(
auto campIt=
CAMPS.rbegin() ; campIt !=
CAMPS.rend() ; ++campIt )
917 ( *campIt )->BootstrapSetResourcePool(
nullptr);
918 ( *campIt )->BootstrapSetConfig(
nullptr);
920 if(( *campIt ) == targetCamp )
925 && targetCamp ==
CAMPS.front() )
@ Huffman
Huffman encoding (byte based).
@ Incremental
Only distances of the values are written.
@ ALL
All compression methods selected.
@ Sparse
Writes '1' if next value is equal to previous, '0' plus next value otherwise.
@ MinMax
Stores the differences between the minimum and maximum value found.
@ VerySparse
Writes the number of following equal or non equal values.
@ NONE
No compression method selected.
NCString ResourceCategory
BootstrapPhases GetBootstrapState()
SharedConfiguration & GetConfig()
SharedPtr< resources::ResourcePool, MonoAllocator > SPResourcePool
void BootstrapSetConfig(const SharedConfiguration &pConfig)
void BootstrapSetResourcePool(const SPResourcePool &pResourcePool)
SPResourcePool & GetResourcePool()
void InsertDerived(TArgs &&... args)
lang::Placeholder< lang::DbgCriticalSections > DbgCriticalSectionsPH
TLock & GetLock() const noexcept
@ Running
The thread's Run method is currently processed.
@ Started
Method Start was invoked but not running, yet.
@ Terminated
The thread is terminated.
#define IF_ALIB_FILES(...)
#define IF_ALIB_BOXING(...)
#define IF_ALIB_THREADS(...)
#define IF_ALIB_ALOX(...)
#define IF_ALIB_SINGLETONS(...)
#define ALIB_ASSERT_WARNING(cond, domain,...)
#define IF_ALIB_ENUMRECORDS(...)
#define ALIB_ASSERT_ERROR(cond, domain,...)
#define IF_ALIB_EXPRESSIONS(...)
#define ALIB_REL_DBG(releaseCode,...)
void Bootstrap(camp::Camp &camp, const NString &name, character innerDelim=',', character outerDelim=',')
@ Ascending
Chooses ascending sort oder.
@ Descending
Chooses descending sort oder.
@ Right
Denotes the right side of something.
@ Left
Denotes the left side of something.
@ Copy
Chooses not to clear existing data.
@ Move
Chooses to clear existing data.
@ Global
Denotes global reach.
@ Local
Denotes local reach.
@ Center
Chooses centered alignment.
@ Right
Chooses right alignment.
@ Left
Chooses left alignment.
@ Remove
Denotes removals.
@ GetCreate
Denotes to create data if not found.
@ Create
Denotes to create data.
@ Insert
Denotes insertions.
@ Get
Denotes to search data.
@ On
Switch it on, switched on, etc.
@ Off
Switch it off, switched off, etc.
@ Begin
The start of a transaction.
@ End
The end of a transaction.
@ Keep
Chooses not no clear existing data.
@ Clear
Chooses to clear existing data.
@ Keep
Keep whitespaces in string.
@ Trim
Trim whitespaces away.
@ Enabled
Caching is enabled.
@ Disabled
Caching is disabled.
@ KeepWithSender
Keeps responsibility, e.g., when passing an object.
@ Transfer
Transfers responsibility to the receiving party.
@ Omit
Do not propagate changes.
@ ToDescendants
Propagate changes to descendants/children/subcomponents.
@ Absolute
Referring to an absolute value.
@ Safe
Do it or treat it with safety.
@ Unsafe
Omit checks or perform unsafe operations.
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
@ Local
Denotes local time.
@ UTC
Denotes UTC (coordinated universal time).
ALIB_DLL TMonoAllocator< lang::HeapAllocator > GLOBAL_ALLOCATOR
ALIB_DLL RecursiveLock GLOBAL_ALLOCATOR_LOCK
CompilationFlagMeaningsEntry COMPILATION_FLAG_MEANINGS[40]
format::FormatterJavaStyle FormatterJavaStyle
Type alias in namespace alib.
void AssertALibVersionAndFlags(int alibVersion, int alibRevision, TCompilationFlags compilationFlags)
@ Final
The final initialization phase. Here, camps are initializing their custom setup.
camp::Basecamp BASECAMP
The singleton instance of ALib Camp class Basecamp.
void BootstrapAddDefaultCamps()
ShutdownPhases
Termination levels usable with Bootstrapping ALib Camps.
@ Destruct
The main phase of termination that destructs everything.
lang::integer integer
Type alias in namespace alib.
cli::CliCamp CLI
The singleton instance of ALib Camp class CliCamp.
variables::TSharedConfiguration< SharedLock > SharedConfiguration
Type alias in namespace alib.
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
void Bootstrap(BootstrapPhases targetPhase, camp::Camp *targetCamp, int alibVersion, int alibRevision, TCompilationFlags compilationFlags)
format::Formatter Formatter
Type alias in namespace alib.
lox::ALoxCamp ALOX
The singleton instance of ALib Camp class ALoxCamp.
bool NonCampModulesInitialized
files::FilesCamp FILES
The singleton instance of ALib Camp class FilesCamp.
expressions::ExpressionsCamp EXPRESSIONS
The singleton instance of ALib Camp class ExpressionsCamp.
TCompilationFlags COMPILATION_FLAGS
containers::List< TAllocator, T, TRecycling > List
Type alias in namespace alib.
ALIB_DLL List< MonoAllocator, camp::Camp * > CAMPS
This is a struct composing an entry in COMPILATION_FLAG_MEANINGS.