Started making the library sort-of-buildable

This commit is contained in:
Emmanuel BENOîT 2017-11-01 21:44:54 +01:00
parent 221f0c8ef8
commit ccd7cc30ef
55 changed files with 461 additions and 304 deletions

View file

@ -4,10 +4,10 @@
#ifndef _H_EBCL_ALLOC
#define _H_EBCL_ALLOC
#include <lw/lib/Config.hh>
#include <lw/lib/Utilities.hh>
#include <ebcl/Config.hh>
#include <ebcl/Utilities.hh>
#include <atomic>
namespace lw {
namespace ebcl {
/* Helpers for pool allocators. */
@ -237,4 +237,4 @@ class T_ThreadedPoolAllocator
}
#endif //_H_EBCL_ALLOC
#include <lw/lib/inline/Alloc.hh>
#include <ebcl/inline/Alloc.hh>

View file

@ -4,11 +4,11 @@
#ifndef _H_EBCL_ARRAYS
#define _H_EBCL_ARRAYS
#include <lw/lib/Externals.hh>
#include <lw/lib/Pointers.hh>
#include <lw/lib/Utilities.hh>
#include <lw/lib/Types.hh>
namespace lw {
#include <ebcl/Externals.hh>
#include <ebcl/Pointers.hh>
#include <ebcl/Utilities.hh>
#include <ebcl/Types.hh>
namespace ebcl {
/*= DYNAMIC ARRAYS ===========================================================*/
@ -443,4 +443,4 @@ template<
}
#endif // _H_EBCL_ARRAYS
#include <lw/lib/inline/Arrays.hh>
#include <ebcl/inline/Arrays.hh>

View file

@ -2,9 +2,10 @@
/* BINARY READER/WRITER FOR STREAMS *******************************************/
/******************************************************************************/
#pragma once
#include <lw/lib/Streams.hh>
namespace lw {
#ifndef _H_EBCL_BINARYSTREAMS
#define _H_EBCL_BINARYSTREAMS
#include <ebcl/Streams.hh>
namespace ebcl {
/*= OBJECT READER/WRITER TEMPLATES ===========================================*/
@ -166,4 +167,5 @@ struct T_BinaryWriter
}
#include <lw/lib/inline/BinaryStreams.hh>
#include <ebcl/inline/BinaryStreams.hh>
#endif // _H_EBCL_BINARYSTREAMS

View file

@ -9,9 +9,10 @@
* buffer is a template argument) and dynamic (where the size can be changed).
*/
#pragma once
#include <lw/lib/Externals.hh>
namespace lw {
#ifndef _H_EBCL_BUFFERS
#define _H_EBCL_BUFFERS
#include <ebcl/Externals.hh>
namespace ebcl {
/*============================================================================*/
@ -101,4 +102,5 @@ class T_Buffer : public T_BufferBase
} // namespace
#include <lw/lib/inline/Buffers.hh>
#include <ebcl/inline/Buffers.hh>
#endif // _H_EBCL_BUFFERS

View file

@ -3,7 +3,8 @@
/******************************************************************************/
#pragma once
#ifndef _H_EBCL_EXTERNALS
#define _H_EBCL_EXTERNALS
#include <cstddef>
#include <cstdint>
@ -17,3 +18,5 @@
#include <shared_mutex>
#include <thread>
#include <utility>
#endif // _H_EBCL_EXTERNALS

View file

@ -2,10 +2,11 @@
/* HASH INDEX *****************************************************************/
/******************************************************************************/
#pragma once
#include <lw/lib/Externals.hh>
#include <lw/lib/Pointers.hh>
namespace lw {
#ifndef _H_EBCL_HASHINDEX
#define _H_EBCL_HASHINDEX
#include <ebcl/Externals.hh>
#include <ebcl/Pointers.hh>
namespace ebcl {
/*
@ -76,4 +77,5 @@ void swap( T_HashIndex& lhs , T_HashIndex& rhs ) noexcept;
} // namespace
#include <lw/lib/inline/HashIndex.hh>
#include <ebcl/inline/HashIndex.hh>
#endif // _H_EBCL_HASHINDEX

View file

@ -4,9 +4,9 @@
#ifndef _H_LW_LIB_HASHTABLES
#define _H_LW_LIB_HASHTABLES
#include <lw/lib/Arrays.hh>
#include <lw/lib/HashIndex.hh>
namespace lw {
#include <ebcl/Arrays.hh>
#include <ebcl/HashIndex.hh>
namespace ebcl {
// F_KeyMatch< K > - Equality check function for keys
@ -200,4 +200,4 @@ void swap( T_ObjectTable< K , T >& lhs , T_ObjectTable< K , T >& rhs );
}
#endif // _H_LW_LIB_HASHTABLES
#include <lw/lib/inline/HashTables.hh>
#include <ebcl/inline/HashTables.hh>

View file

@ -2,10 +2,10 @@
/* POINTERS *******************************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_POINTERS
#define _H_LW_LIB_POINTERS
#include <lw/lib/Utilities.hh>
namespace lw {
#ifndef _H_EBCL_POINTERS
#define _H_EBCL_POINTERS
#include <ebcl/Utilities.hh>
namespace ebcl {
template< typename T > class T_OwnPtr;
template< typename T > class T_SharedPtr;
@ -419,5 +419,5 @@ template<
} // namespace
#endif // _H_LW_LIB_POINTERS
#include <lw/lib/inline/Pointers.hh>
#endif // _H_EBCL_POINTERS
#include <ebcl/inline/Pointers.hh>

View file

@ -2,12 +2,13 @@
/* STREAMS ********************************************************************/
/******************************************************************************/
#pragma once
#include <lw/lib/Externals.hh>
#include <lw/lib/Utilities.hh>
#include <lw/lib/Pointers.hh>
#include <lw/lib/Buffers.hh>
namespace lw {
#ifndef _H_EBCL_STREAMS
#define _H_EBCL_STREAMS
#include <ebcl/Externals.hh>
#include <ebcl/Utilities.hh>
#include <ebcl/Pointers.hh>
#include <ebcl/Buffers.hh>
namespace ebcl {
/*= STREAM ERRORS ============================================================*/
@ -107,4 +108,5 @@ class A_OutputStream : public A_Stream
M_ABSTRACT_POINTERS( OutputStream );
} // namespace
#include <lw/lib/inline/Streams.hh>
#include <ebcl/inline/Streams.hh>
#endif // _H_EBCL_STREAMS

View file

@ -2,13 +2,13 @@
/* STRINGS AND RELATED UTILITIES **********************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_STRINGS
#define _H_LW_LIB_STRINGS
#include <lw/lib/Externals.hh>
#include <lw/lib/Pointers.hh>
#include <lw/lib/Arrays.hh>
#include <lw/lib/BinaryStreams.hh>
namespace lw {
#ifndef _H_EBCL_STRINGS
#define _H_EBCL_STRINGS
#include <ebcl/Externals.hh>
#include <ebcl/Pointers.hh>
#include <ebcl/Arrays.hh>
#include <ebcl/BinaryStreams.hh>
namespace ebcl {
/*= UTF-8 UTILITY FUNCTIONS ==================================================*/
@ -453,5 +453,5 @@ M_LSHIFT_OP( T_StringBuilder , double );
} // namespace
#endif // _H_LW_LIB_STRINGS
#include <lw/lib/inline/Strings.hh>
#endif // _H_EBCL_STRINGS
#include <ebcl/inline/Strings.hh>

View file

@ -2,12 +2,12 @@
/* THREADING ******************************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_THREADING
#define _H_LW_LIB_THREADING
#ifndef _H_EBCL_THREADING
#define _H_EBCL_THREADING
#include <lw/lib/Pointers.hh>
#include <lw/lib/Arrays.hh>
namespace lw {
#include <ebcl/Pointers.hh>
#include <ebcl/Arrays.hh>
namespace ebcl {
/*= ALIASES ==================================================================*/
@ -146,5 +146,5 @@ void swap( T_RingBuffer< T >& lhs , T_RingBuffer< T >& rhs ) noexcept;
}
#endif // _H_LW_LIB_THREADING
#include <lw/lib/inline/Threading.hh>
#endif // _H_EBCL_THREADING
#include <ebcl/inline/Threading.hh>

View file

@ -2,11 +2,11 @@
/* CONTAINER TYPES ************************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_TYPES
#define _H_LW_LIB_TYPES
#include <lw/lib/Utilities.hh>
#include <lw/lib/Pointers.hh>
namespace lw {
#ifndef _H_EBCL_TYPES
#define _H_EBCL_TYPES
#include <ebcl/Utilities.hh>
#include <ebcl/Pointers.hh>
namespace ebcl {
/*= VARIANT TYPE =============================================================*/
@ -494,5 +494,5 @@ template< typename... Types >
} // namespace
#endif // _H_LW_LIB_TYPES
#include <lw/lib/inline/Types.hh>
#endif // _H_EBCL_TYPES
#include <ebcl/inline/Types.hh>

View file

@ -2,10 +2,10 @@
/* VARIOUS UTILITIES **********************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_UTILITIES
#define _H_LW_LIB_UTILITIES
#include <lw/lib/Externals.hh>
namespace lw {
#ifndef _H_EBCL_UTILITIES
#define _H_EBCL_UTILITIES
#include <ebcl/Externals.hh>
namespace ebcl {
// IsPowerOf2( v ) - Is some integer a power of 2 ?
@ -310,7 +310,7 @@ struct T_Comparator
#define M_DEFINE_COMPARATOR( Type ) \
int T_Comparator< Type >::compare( Type const & a , Type const & b )
int ::ebcl::T_Comparator< Type >::compare( Type const & a , Type const & b )
// Instantiate some commonly used comparators
extern template struct T_Comparator< uint32_t >;
@ -389,5 +389,5 @@ class A_PrivateImplementation
} // namespace
#endif // _H_LW_LIB_UTILITIES
#include <lw/lib/inline/Utilities.hh>
#endif // _H_EBCL_UTILITIES
#include <ebcl/inline/Utilities.hh>

View file

@ -2,10 +2,10 @@
/* ALLOCATORS - INLINE CODE ***************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_ALLOC
#define _H_LW_LIB_INLINE_ALLOC
#include <lw/lib/Alloc.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_ALLOC
#define _H_EBCL_INLINE_ALLOC
#include <ebcl/Alloc.hh>
namespace ebcl {
/*= T_PoolHelper::T_List =====================================================*/
@ -373,4 +373,4 @@ void T_ThreadedPoolAllocator< OS , OA , P , M >::addToStack(
}
#endif //_H_LW_LIB_INLINE_ALLOC
#endif //_H_EBCL_INLINE_ALLOC

View file

@ -2,10 +2,10 @@
/* ARRAYS - INLINE CODE *******************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_ARRAYS
#define _H_LW_LIB_INLINE_ARRAYS
#include <lw/lib/Arrays.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_ARRAYS
#define _H_EBCL_INLINE_ARRAYS
#include <ebcl/Arrays.hh>
namespace ebcl {
/*= T_Array ==================================================================*/
@ -1591,4 +1591,4 @@ inline T_Array< T > const& T_AutoArray< T , S , G >::dynamic_( ) const noexcept
} // namespace
#endif // _H_LW_LIB_INLINE_ARRAYS
#endif // _H_EBCL_INLINE_ARRAYS

View file

@ -2,9 +2,10 @@
/* BINARY READER/WRITER FOR STREAMS - INLINE CODE *****************************/
/******************************************************************************/
#pragma once
#include <lw/lib/BinaryStreams.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_BINARYSTREAMS
#define _H_EBCL_INLINE_BINARYSTREAMS
#include <ebcl/BinaryStreams.hh>
namespace ebcl {
/*= T_BinaryReader ===========================================================*/
@ -143,3 +144,4 @@ inline void T_BinaryWriter::T_Writer_< T , false >::write( T_BinaryWriter const&
} // namespace
#endif // _H_EBCL_INLINE_BINARYSTREAMS

View file

@ -2,9 +2,10 @@
/* BUFFERS - INLINE CODE ******************************************************/
/******************************************************************************/
#pragma once
#include <lw/lib/Buffers.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_BUFFERS
#define _H_EBCL_INLINE_BUFFERS
#include <ebcl/Buffers.hh>
namespace ebcl {
/*= T_BufferBase =============================================================*/
@ -261,3 +262,4 @@ inline T_Buffer< T >& T_Buffer< T >::copyAll( T const* data )
} // namespace
#endif // _H_EBCL_INLINE_BUFFERS

View file

@ -2,9 +2,10 @@
/* HASH INDEX - INLINE CODE ***************************************************/
/******************************************************************************/
#pragma once
#include <lw/lib/HashIndex.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_HASHINDEX
#define _H_EBCL_INLINE_HHASHINDEX
#include <ebcl/HashIndex.hh>
namespace ebcl {
/*= T_HashIndex ==============================================================*/
@ -27,3 +28,4 @@ inline uint32_t T_HashIndex::next( uint32_t index ) const
}
#endif //_H_EBCL_INLINE_HHASHINDEX

View file

@ -2,10 +2,10 @@
/* HASH TABLES - INLINE CODE **************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_HASHTABLES
#define _H_LW_LIB_INLINE_HASHTABLES
#include <lw/lib/HashTables.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_HASHTABLES
#define _H_EBCL_INLINE_HASHTABLES
#include <ebcl/HashTables.hh>
namespace ebcl {
/*= T_DefaultKeyMatch ========================================================*/
@ -418,4 +418,4 @@ inline uint32_t T_ObjectTable< K , V >::find( K const& k , uint32_t hash ) const
} // namespace
#endif // _H_LW_LIB_INLINE_HASHTABLES
#endif // _H_EBCL_INLINE_HASHTABLES

View file

@ -2,10 +2,10 @@
/* POINTERS - INLINE CODE *****************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_POINTERS
#define _H_LW_LIB_INLINE_POINTERS
#include <lw/lib/Pointers.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_POINTERS
#define _H_EBCL_INLINE_POINTERS
#include <ebcl/Pointers.hh>
namespace ebcl {
/*= T_OwnPtr =================================================================*/
@ -851,4 +851,4 @@ template<
} // namespace
#endif // _H_LW_LIB_INLINE_POINTERS
#endif // _H_EBCL_INLINE_POINTERS

View file

@ -2,9 +2,10 @@
/* STREAMS - INLINE CODE ******************************************************/
/******************************************************************************/
#pragma once
#include <lw/lib/Streams.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_STREAMS
#define _H_EBCL_INLINE_STREAMS
#include <ebcl/Streams.hh>
namespace ebcl {
/*= X_StreamError ============================================================*/
@ -96,3 +97,4 @@ inline A_OutputStream::A_OutputStream( size_t position , size_t size ) noexcept
} // namespace
#endif // _H_EBCL_INLINE_STREAMS

View file

@ -2,10 +2,10 @@
/* STRINGS AND RELATED UTILITIES - INLINE CODE ********************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_STRINGS
#define _H_LW_LIB_INLINE_STRINGS
#include <lw/lib/Strings.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_STRINGS
#define _H_EBCL_INLINE_STRINGS
#include <ebcl/Strings.hh>
namespace ebcl {
/*= T_Character ==============================================================*/
@ -588,4 +588,4 @@ inline T_StringBuilder& operator<< ( T_StringBuilder& sb , double value )
} // namespace
#endif // _H_LW_LIB_INLINE_STRINGS
#endif // _H_EBCL_INLINE_STRINGS

View file

@ -2,10 +2,10 @@
/* THREADING - INLINE CODE ****************************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_THREADING
#define _H_LW_LIB_INLINE_THREADING
#include <lw/lib/Threading.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_THREADING
#define _H_EBCL_INLINE_THREADING
#include <ebcl/Threading.hh>
namespace ebcl {
/*= T_ReadWriteMutex =========================================================*/
@ -349,4 +349,4 @@ inline void T_RingBuffer< T >::expand( )
}
#endif // _H_LW_LIB_INLINE_THREADING
#endif // _H_EBCL_INLINE_THREADING

View file

@ -2,10 +2,10 @@
/* CONTAINER TYPES - INLINE CODE **********************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_TYPES
#define _H_LW_LIB_INLINE_TYPES
#include <lw/lib/Types.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_TYPES
#define _H_EBCL_INLINE_TYPES
#include <ebcl/Types.hh>
namespace ebcl {
/*= VARIANT TYPE =============================================================*/
@ -126,7 +126,7 @@ inline void T_VariantHelper::T_InPlaceHandler< Type >::action(
case E_HandlerOp::MKHDL:
{
const E_HandlerMode mode( *( (E_HandlerMode*) &source ) );
const E_HandlerMode mode( *new ((char*)&source) E_HandlerMode );
if ( mode == E_HandlerMode::IN_PLACE ) {
*( (F_Handler*) dest) = &T_InPlaceHandler< Type >::action;
} else {
@ -230,7 +230,7 @@ inline void T_VariantHelper::T_HeapHandler< Type >::action(
case E_HandlerOp::MKHDL:
{
const E_HandlerMode mode( *( (E_HandlerMode*) &source ) );
const E_HandlerMode mode( *new ((char*)&source) E_HandlerMode );
if ( mode == E_HandlerMode::IN_PLACE ) {
*( (F_Handler*) dest) = &T_InPlaceHandler< Type >::action;
} else {
@ -996,5 +996,5 @@ inline void T_Union< TL... >::moveImpl( T_Storage_* from , T_Storage_* to )
} // namespace
#endif // _H_LW_LIB_INLINE_TYPES
#endif // _H_EBCL_INLINE_TYPES

View file

@ -2,10 +2,10 @@
/* VARIOUS UTILITIES - INLINE CODE ********************************************/
/******************************************************************************/
#ifndef _H_LW_LIB_INLINE_UTILITIES
#define _H_LW_LIB_INLINE_UTILITIES
#include <lw/lib/Utilities.hh>
namespace lw {
#ifndef _H_EBCL_INLINE_UTILITIES
#define _H_EBCL_INLINE_UTILITIES
#include <ebcl/Utilities.hh>
namespace ebcl {
template< typename T >
@ -300,4 +300,4 @@ inline void A_PrivateImplementation::callPrivateDestructor( ) noexcept
}
#endif // _H_LW_LIB_INLINE_UTILITIES
#endif // _H_EBCL_INLINE_UTILITIES