Finished importing the good bits from LW's library
This commit is contained in:
parent
b9d77922ed
commit
4ab3dc1b29
82 changed files with 177 additions and 24084 deletions
|
@ -5,9 +5,9 @@
|
|||
#ifndef _H_EBCL_DYNLIB
|
||||
#define _H_EBCL_DYNLIB
|
||||
|
||||
#include <lw/lib/Strings.hh>
|
||||
#include <lw/lib/Utilities.hh>
|
||||
namespace lw {
|
||||
#include <ebcl/Strings.hh>
|
||||
#include <ebcl/Utilities.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= DYNAMIC LIBRARY SUPPORT ==================================================*/
|
||||
|
@ -45,4 +45,4 @@ M_CLASS_POINTERS( DynLib );
|
|||
|
||||
} // namespace lw
|
||||
#endif // _H_EBCL_DYNLIB
|
||||
#include <lw/lib/inline/DynLib.hh>
|
||||
#include <ebcl/inline/DynLib.hh>
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* GAME'S MAIN LOOP ***********************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_GAMELOOP
|
||||
#define _H_LW_LIB_GAMELOOP
|
||||
#include <lw/lib/Messages.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
/*= GAME LOOP ================================================================*/
|
||||
|
||||
class T_GameLoop : public A_PrivateImplementation
|
||||
{
|
||||
public:
|
||||
T_GameLoop( ) noexcept;
|
||||
T_GameLoop( T_GameLoop const& ) = delete;
|
||||
T_GameLoop( T_GameLoop&& ) = delete;
|
||||
|
||||
bool active( ) const noexcept;
|
||||
void start( ) noexcept;
|
||||
void shutdown( ) noexcept;
|
||||
|
||||
void putMessage( T_UIMessage&& message ) noexcept;
|
||||
};
|
||||
M_CLASS_POINTERS( GameLoop );
|
||||
|
||||
|
||||
}
|
||||
#endif // _H_LW_LIB_GAMELOOP
|
|
@ -1,282 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* UI<=>GAME MESSAGES *********************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_MESSAGES
|
||||
#define _H_LW_LIB_MESSAGES
|
||||
#include <lw/lib/Strings.hh>
|
||||
#include <lw/lib/Types.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
/*= VIEWS ====================================================================*/
|
||||
|
||||
/* Empty abstract class that serves as a base for game views */
|
||||
class A_GameView
|
||||
{
|
||||
public:
|
||||
virtual ~A_GameView( ) = 0;
|
||||
};
|
||||
M_ABSTRACT_POINTERS( GameView );
|
||||
|
||||
|
||||
/* Abstract class for a view builder
|
||||
*
|
||||
* User interfaces need to access the game's data in order to display it. View
|
||||
* builders provide a way to do that; they are passed to the game's main loop
|
||||
* by the UI. Once set, they will be used to create and update view data.
|
||||
*/
|
||||
class A_ViewBuilder
|
||||
{
|
||||
public:
|
||||
virtual ~A_ViewBuilder( ) = 0;
|
||||
|
||||
/* This method creates a view instance. It is called twice when the
|
||||
* builder is installed, in order to create a "double buffer" - one
|
||||
* view can be sent to the UI while the other is being updated.
|
||||
*/
|
||||
virtual OP_GameView createView( ) = 0;
|
||||
|
||||
/* This method is responsible for updating a view instance. */
|
||||
virtual void updateView( OP_GameView view ) = 0;
|
||||
};
|
||||
M_ABSTRACT_POINTERS( ViewBuilder );
|
||||
|
||||
|
||||
/*= GAME STATE ===============================================================*/
|
||||
|
||||
/* State of the main loop */
|
||||
enum class E_GameState {
|
||||
NO_GAME , // No game loaded
|
||||
GAME_PAUSED , // Game is loaded but not running
|
||||
GAME_SLOW , // Game is running at slow speed
|
||||
GAME_NORMAL , // Game is running at normal speed
|
||||
GAME_FAST // Game is running at high speed
|
||||
};
|
||||
M_LSHIFT_OP( T_StringBuilder , E_GameState );
|
||||
|
||||
|
||||
/*= PROGRESS INFORMATION =====================================================*/
|
||||
|
||||
/* Progress information for long operations - part (main or sub) */
|
||||
class T_ProgressInfoPart
|
||||
{
|
||||
private:
|
||||
T_String text_;
|
||||
uint32_t progress_;
|
||||
uint32_t total_;
|
||||
|
||||
public:
|
||||
T_ProgressInfoPart( ) = delete;
|
||||
T_ProgressInfoPart( T_String text , uint32_t progress , uint32_t total ) noexcept;
|
||||
T_ProgressInfoPart( T_ProgressInfoPart&& other ) noexcept;
|
||||
T_ProgressInfoPart( T_ProgressInfoPart const& other );
|
||||
|
||||
T_String const& text( ) const noexcept;
|
||||
uint32_t progress( ) const noexcept;
|
||||
uint32_t total( ) const noexcept;
|
||||
};
|
||||
|
||||
/* Progress information for long operations - main */
|
||||
class T_ProgressInfo
|
||||
{
|
||||
private:
|
||||
T_ProgressInfoPart main_;
|
||||
T_Optional< T_ProgressInfoPart > sub_;
|
||||
|
||||
public:
|
||||
T_ProgressInfo( ) = delete;
|
||||
T_ProgressInfo( T_String text , uint32_t progress , uint32_t total ) noexcept;
|
||||
explicit T_ProgressInfo( T_ProgressInfoPart main ) noexcept;
|
||||
T_ProgressInfo( T_ProgressInfoPart main , T_ProgressInfoPart sub ) noexcept;
|
||||
T_ProgressInfo( T_ProgressInfoPart main ,
|
||||
T_String sText , uint32_t sProgress , uint32_t sTotal ) noexcept;
|
||||
T_ProgressInfo( T_String text , uint32_t progress , uint32_t total ,
|
||||
T_String sText , uint32_t sProgress , uint32_t sTotal ) noexcept;
|
||||
T_ProgressInfo( T_ProgressInfo&& other ) noexcept;
|
||||
T_ProgressInfo( T_ProgressInfo const& other ) = delete;
|
||||
|
||||
T_ProgressInfoPart const& main( ) const noexcept;
|
||||
bool hasSub( ) const noexcept;
|
||||
T_ProgressInfoPart const& sub( ) const;
|
||||
};
|
||||
M_CLASS_POINTERS( ProgressInfo );
|
||||
|
||||
|
||||
/*= MESSAGES =================================================================*/
|
||||
|
||||
/* Types of messages sent by the UI to the game */
|
||||
enum class E_GameUIMessage {
|
||||
/* Create a new game
|
||||
* Data: XXX
|
||||
*/
|
||||
NEW ,
|
||||
/* Load an existing game
|
||||
* Data: uint32_t - game identifier
|
||||
*/
|
||||
LOAD ,
|
||||
/* Save the current game
|
||||
* Data: none
|
||||
*/
|
||||
SAVE ,
|
||||
/* Quit the current game
|
||||
* Data: none
|
||||
*/
|
||||
STOP ,
|
||||
/* Quit current game (if any) the exit the main loop
|
||||
* Data: none
|
||||
*/
|
||||
QUIT ,
|
||||
|
||||
/* Abort the current operation
|
||||
* Data: none
|
||||
*/
|
||||
ABORT ,
|
||||
|
||||
/* Delete a saved game
|
||||
* Data: uint32_t - game identifier
|
||||
*/
|
||||
DELETE ,
|
||||
/* Copy or rename a saved game
|
||||
* Data: XXX
|
||||
*/
|
||||
COPY_OR_RENAME ,
|
||||
|
||||
/* Set the current game's speed
|
||||
* Data: E_GameState (but NO_GAME will be ignored)
|
||||
*/
|
||||
SET_SPEED ,
|
||||
/* Execute computation steps
|
||||
* Data: XXX
|
||||
*/
|
||||
STEPS ,
|
||||
/* Set a view builder
|
||||
* Data: XXX
|
||||
*/
|
||||
SET_VIEW ,
|
||||
/* Indicate that a view has been displayed
|
||||
* Data: T_String - identifier of the view
|
||||
*/
|
||||
VIEW_DISPLAYED ,
|
||||
/* Send a query to the game
|
||||
* Data: XXX
|
||||
*/
|
||||
QUERY ,
|
||||
/* Send a command to the game
|
||||
* Data: XXX
|
||||
*/
|
||||
COMMAND
|
||||
};
|
||||
M_LSHIFT_OP( T_StringBuilder , E_GameUIMessage );
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Types of messages sent by the main loop to the UI */
|
||||
enum class E_GameLoopMessage {
|
||||
/* Main loop exiting
|
||||
* Data: none
|
||||
*/
|
||||
TERMINATED ,
|
||||
/* Progress information
|
||||
* Data: T_ProgressInfo
|
||||
*/
|
||||
PROGRESS ,
|
||||
/* Operation completed
|
||||
* Data: none
|
||||
*/
|
||||
DONE ,
|
||||
/* State changed
|
||||
* Data: E_GameState
|
||||
*/
|
||||
STATE_CHANGED ,
|
||||
/* Indicate that a view is available
|
||||
* Data: XXX
|
||||
*/
|
||||
VIEW_AVAILABLE ,
|
||||
/* Query response
|
||||
* Data: XXX
|
||||
*/
|
||||
QUERY_RESPONSE ,
|
||||
/* Command execution - success
|
||||
* Data: none
|
||||
*/
|
||||
COMMAND_OK ,
|
||||
/* Command execution - syntax error
|
||||
* Data: XXX
|
||||
*/
|
||||
COMMAND_SYNTAX ,
|
||||
/* Command execution - error
|
||||
* Data: XXX
|
||||
*/
|
||||
COMMAND_ERROR ,
|
||||
};
|
||||
M_LSHIFT_OP( T_StringBuilder , E_GameLoopMessage );
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Types for message data */
|
||||
using T_GameUIMessageData = T_Union<
|
||||
uint32_t ,
|
||||
T_String ,
|
||||
E_GameState
|
||||
>;
|
||||
using T_GameLoopMessageData = T_Union<
|
||||
T_ProgressInfo ,
|
||||
E_GameState
|
||||
>;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Message direction */
|
||||
enum class E_MessageDirection {
|
||||
FROM_UI_TO_GAME ,
|
||||
FROM_GAME_TO_UI
|
||||
};
|
||||
|
||||
/* Message class template, can be used for both directions */
|
||||
template<
|
||||
E_MessageDirection Direction ,
|
||||
typename EType = std::conditional_t<
|
||||
Direction == E_MessageDirection::FROM_UI_TO_GAME ,
|
||||
E_GameUIMessage , E_GameLoopMessage > ,
|
||||
typename DType = std::conditional_t<
|
||||
Direction == E_MessageDirection::FROM_UI_TO_GAME ,
|
||||
T_GameUIMessageData , T_GameLoopMessageData >
|
||||
>
|
||||
class T_GameMessage
|
||||
{
|
||||
public:
|
||||
using T_Type = EType;
|
||||
using T_Data = DType;
|
||||
|
||||
private:
|
||||
using T_Self_ = T_GameMessage< Direction >;
|
||||
T_Optional< T_Type > type_;
|
||||
T_Optional< T_Data > data_;
|
||||
|
||||
public:
|
||||
constexpr T_GameMessage( ) noexcept;
|
||||
constexpr T_GameMessage( T_Type type ) noexcept;
|
||||
T_GameMessage( T_Type type , T_Data data ) noexcept;
|
||||
T_GameMessage( T_Self_ const& ) = delete;
|
||||
T_GameMessage( T_Self_&& other ) noexcept;
|
||||
|
||||
T_Self_& operator =( T_Self_ const& ) = delete;
|
||||
T_Self_& operator =( T_Self_&& other ) noexcept;
|
||||
|
||||
constexpr bool hasMessage( ) const noexcept;
|
||||
constexpr T_Type type( ) const noexcept;
|
||||
|
||||
template< typename T >
|
||||
constexpr T const& data( ) const;
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
using T_UIMessage = T_GameMessage< E_MessageDirection::FROM_UI_TO_GAME >;
|
||||
using T_LoopMessage = T_GameMessage< E_MessageDirection::FROM_GAME_TO_UI >;
|
||||
|
||||
|
||||
} // namespace lw
|
||||
#endif // _H_LW_LIB_MESSAGES
|
||||
#include <lw/lib/inline/Messages.hh>
|
|
@ -1,247 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* MODDING SYSTEM *************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_MODS
|
||||
#define _H_LW_LIB_MODS
|
||||
#include <lw/lib/Log.hh>
|
||||
#include <lw/lib/ModInterface.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
/*= MOD INFORMATION ==========================================================*/
|
||||
|
||||
/* Mod identifier (name + version) */
|
||||
struct T_ModIdentifier {
|
||||
T_String name;
|
||||
uint32_t version; // Main version number used for dependencies
|
||||
|
||||
bool operator ==( T_ModIdentifier const& other ) const noexcept;
|
||||
bool operator !=( T_ModIdentifier const& other ) const noexcept;
|
||||
|
||||
int compare( T_ModIdentifier const& other ) const noexcept;
|
||||
};
|
||||
M_CLASS_POINTERS( ModIdentifier );
|
||||
M_DECLARE_HASH( T_ModIdentifier );
|
||||
M_DECLARE_COMPARATOR( T_ModIdentifier );
|
||||
M_LSHIFT_OP( T_StringBuilder , T_ModIdentifier const& );
|
||||
|
||||
/* Types of mods */
|
||||
enum class E_ModType {
|
||||
DATA , // This mod consists of data only
|
||||
NATIVE , // This mod consists of native code
|
||||
UI , // This mod is an user interface
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/* Mod information record */
|
||||
struct T_ModInfo
|
||||
{
|
||||
T_String path;
|
||||
E_ModType type;
|
||||
|
||||
/* Mod name, version and revision (the latter is for changes that don't
|
||||
* affect the interface).
|
||||
*/
|
||||
T_ModIdentifier identifier;
|
||||
uint32_t revision;
|
||||
|
||||
/* Required library version number */
|
||||
uint32_t libVersion;
|
||||
|
||||
/* List of dependencies */
|
||||
T_Array< T_ModIdentifier > modDeps;
|
||||
|
||||
/* Is this mod an user interface mod? */
|
||||
bool isUserInterface( ) const noexcept;
|
||||
};
|
||||
M_CLASS_POINTERS( ModInfo );
|
||||
M_LSHIFT_OP( T_StringBuilder , T_ModInfo const& );
|
||||
|
||||
|
||||
/*= MODS MANAGER CONFIGURATION ===============================================*/
|
||||
|
||||
/* Loading mode for a mod */
|
||||
enum class E_ModMode {
|
||||
EXCLUDE , // Never load this mod
|
||||
AUTO , // Load the most appropriate version of the mod
|
||||
VERSION , // Load a specific version of the mod, fails
|
||||
// if the mod in the specified version is not
|
||||
// present
|
||||
REQUIRE // Require that the specified mod be present
|
||||
|
||||
// Note that both VERSION and REQUIRE can apply to an UI-specific mod;
|
||||
// while the mod will not be loaded if the corresponding UI isn't,
|
||||
// its presence will still be required.
|
||||
};
|
||||
|
||||
/* Mods manager configuration */
|
||||
class T_ModsManagerConfiguration : public A_PrivateImplementation
|
||||
{
|
||||
public:
|
||||
T_ModsManagerConfiguration( ) noexcept;
|
||||
|
||||
T_ModsManagerConfiguration(
|
||||
T_ModsManagerConfiguration const& ) = delete;
|
||||
T_ModsManagerConfiguration& operator =(
|
||||
T_ModsManagerConfiguration const& ) = delete;
|
||||
|
||||
T_ModsManagerConfiguration(
|
||||
T_ModsManagerConfiguration&& ) noexcept;
|
||||
T_ModsManagerConfiguration& operator =(
|
||||
T_ModsManagerConfiguration&& other ) noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Set a mod configuration entry */
|
||||
void setAuto( T_String const& name ) noexcept;
|
||||
void setRequired( T_String const& name ) noexcept;
|
||||
void setExcluded( T_String const& name ) noexcept;
|
||||
void setVersion( T_String const& name ,
|
||||
uint32_t version ) noexcept;
|
||||
void setVersion( T_String const& name ,
|
||||
uint32_t version ,
|
||||
uint32_t revision ) noexcept;
|
||||
|
||||
/* Query mod configuration */
|
||||
T_Array< T_String > configured( ) const noexcept;
|
||||
E_ModMode modeFor( T_String const& name ) const noexcept;
|
||||
uint32_t requiredVersion( T_String const& name ) const noexcept;
|
||||
T_Optional< uint32_t > requiredRevision(
|
||||
T_String const& name ) const noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Set or clear an UI preference */
|
||||
void setUIPreference(
|
||||
T_String const& name ,
|
||||
int32_t weight ) noexcept;
|
||||
void clearUIPreference(
|
||||
T_String const& name ) noexcept;
|
||||
|
||||
/* List UI preferences */
|
||||
T_Array< T_String > uiPreferences( ) const noexcept;
|
||||
/* Get the preference for an UI */
|
||||
int32_t uiPreference(
|
||||
T_String const& name ) const noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Filter a list of mods using the configuration's exclusions and
|
||||
* version limits.
|
||||
*/
|
||||
T_Array< RPC_ModInfo > filterMods(
|
||||
T_Array< RPC_ModInfo > const& mods ) const noexcept;
|
||||
/* Generate the list of required mods. This includes all mods that
|
||||
* have been set as required, and all mods that have a version
|
||||
* requirement.
|
||||
*/
|
||||
T_Array< T_String > requiredMods( ) const noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Get a default configuration */
|
||||
static T_ModsManagerConfiguration DefaultConfiguration( ) noexcept;
|
||||
|
||||
/* Get the parser's configuration used to load mods manager configuration */
|
||||
static T_SRDParserConfig GetParserConfig( );
|
||||
};
|
||||
M_CLASS_POINTERS( ModsManagerConfiguration );
|
||||
|
||||
|
||||
/*= MODS DEPENDENCY GRAPH ====================================================*/
|
||||
|
||||
class T_ModsDependencies : public A_PrivateImplementation
|
||||
{
|
||||
public:
|
||||
T_ModsDependencies( ) noexcept;
|
||||
T_ModsDependencies(
|
||||
T_Logger& logger ,
|
||||
T_Array< RPC_ModInfo > const& mods ,
|
||||
T_ModsManagerConfiguration const& config ) noexcept;
|
||||
|
||||
T_ModsDependencies(
|
||||
T_ModsDependencies const& other ) noexcept;
|
||||
T_ModsDependencies& operator =(
|
||||
T_ModsDependencies const& other ) noexcept;
|
||||
|
||||
T_ModsDependencies(
|
||||
T_ModsDependencies&& other ) noexcept;
|
||||
T_ModsDependencies& operator =(
|
||||
T_ModsDependencies&& other ) noexcept;
|
||||
|
||||
friend M_DECLARE_SWAP( T_ModsDependencies );
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
bool resolved( ) const;
|
||||
bool ambiguous( ) const;
|
||||
T_Array< T_String > userInterfaces( ) const;
|
||||
T_Array< RPC_ModInfo > const& commonMods( ) const;
|
||||
T_Array< RPC_ModInfo >::RPC forUserInterface(
|
||||
T_String const& name ) const;
|
||||
};
|
||||
M_CLASS_POINTERS( ModsDependencies );
|
||||
M_DECLARE_SWAP( T_ModsDependencies );
|
||||
|
||||
|
||||
/*= MODS MANAGER =============================================================*/
|
||||
|
||||
/* Function type for a function that generates a feedback function used to
|
||||
* update the initialisation progress when the mods are being initialised.
|
||||
*/
|
||||
using F_CreateInitUpdater = std::function< F_UpdateInitProgress( RPC_ModInfo ) >;
|
||||
|
||||
class T_ModsManager : public A_PrivateImplementation
|
||||
{
|
||||
public:
|
||||
T_ModsManager( ) = delete;
|
||||
T_ModsManager( T_ModsManager const& ) = delete;
|
||||
T_ModsManager( T_ModsManager&& ) noexcept = delete;
|
||||
|
||||
T_ModsManager( T_ModsManagerConfiguration&& config ) noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Find available mods, load their descriptions */
|
||||
bool scanForMods( );
|
||||
/* Get the list of available mods */
|
||||
T_Array< RPC_ModInfo > availableMods( ) const noexcept;
|
||||
|
||||
/* Resolve dependencies between mods using the configuration;
|
||||
* returns true if there is a valid set of mods.
|
||||
*/
|
||||
bool resolveDependencies( ) noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Pre-initialise common mods */
|
||||
bool preinitCommon( ) noexcept;
|
||||
/* Pre-initialise UI mods and try to start the user interface. */
|
||||
OP_UserInterface preinitUIMods(
|
||||
T_String const& ui ) noexcept;
|
||||
/* Try to pre-initialise an UI mod. */
|
||||
OP_UserInterface preinitUIMods( ) noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Get the amount of loaded mods */
|
||||
uint32_t modsCount( ) const noexcept;
|
||||
/* Initialise the mods, sending progress updates along the way */
|
||||
bool initialise(
|
||||
F_CreateInitUpdater const& fciu ) noexcept;
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
/* Shutdown all initialised mods. */
|
||||
void shutdown( ) noexcept;
|
||||
/* Unload all mods, calling post-shutdown routines if available */
|
||||
void unload( ) noexcept;
|
||||
};
|
||||
M_CLASS_POINTERS( ModsManager );
|
||||
|
||||
|
||||
} // namespace lw
|
||||
#endif // _H_LW_LIB_MODS
|
||||
#include <lw/lib/inline/Mods.hh>
|
|
@ -399,23 +399,23 @@ template<
|
|||
#define M_CLASS_POINTERS( NAME ) \
|
||||
typedef T_ ## NAME* RP_ ## NAME; \
|
||||
typedef T_ ## NAME const* RPC_ ## NAME; \
|
||||
typedef T_OwnPtr< T_ ## NAME > OP_ ## NAME; \
|
||||
typedef T_SharedPtr< T_ ## NAME > SP_ ## NAME; \
|
||||
typedef T_WeakPtr< T_ ## NAME > WP_ ## NAME
|
||||
typedef ::ebcl::T_OwnPtr< T_ ## NAME > OP_ ## NAME; \
|
||||
typedef ::ebcl::T_SharedPtr< T_ ## NAME > SP_ ## NAME; \
|
||||
typedef ::ebcl::T_WeakPtr< T_ ## NAME > WP_ ## NAME
|
||||
|
||||
#define M_ABSTRACT_POINTERS( NAME ) \
|
||||
typedef A_ ## NAME* RP_ ## NAME; \
|
||||
typedef A_ ## NAME const* RPC_ ## NAME; \
|
||||
typedef T_OwnPtr< A_ ## NAME > OP_ ## NAME; \
|
||||
typedef T_SharedPtr< A_ ## NAME > SP_ ## NAME; \
|
||||
typedef T_WeakPtr< A_ ## NAME > WP_ ## NAME
|
||||
typedef ::ebcl::T_OwnPtr< A_ ## NAME > OP_ ## NAME; \
|
||||
typedef ::ebcl::T_SharedPtr< A_ ## NAME > SP_ ## NAME; \
|
||||
typedef ::ebcl::T_WeakPtr< A_ ## NAME > WP_ ## NAME
|
||||
|
||||
#define M_TEMPLATE_POINTERS( NAME ) \
|
||||
typedef NAME* RP; \
|
||||
typedef NAME const* RPC; \
|
||||
typedef T_OwnPtr< NAME > OP; \
|
||||
typedef T_SharedPtr< NAME > SP; \
|
||||
typedef T_WeakPtr< NAME > WP
|
||||
typedef ::ebcl::T_OwnPtr< NAME > OP; \
|
||||
typedef ::ebcl::T_SharedPtr< NAME > SP; \
|
||||
typedef ::ebcl::T_WeakPtr< NAME > WP
|
||||
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
/* SRD - BINARY STORAGE *******************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDBINARY
|
||||
#define _H_LW_LIB_SRDBINARY
|
||||
#include <lw/lib/SRDIO.hh>
|
||||
#include <lw/lib/HashIndex.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDBINARY
|
||||
#define _H_EBCL_SRDBINARY
|
||||
#include <ebcl/SRDIO.hh>
|
||||
#include <ebcl/HashIndex.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= WRITER ===================================================================*/
|
||||
|
@ -74,5 +74,5 @@ T_SRDList SRDBinaryReadFrom( T_String const& name , A_InputStream& input , bool
|
|||
|
||||
|
||||
} // namespace
|
||||
#include <lw/lib/inline/SRDBinary.hh>
|
||||
#endif // _H_LW_LIB_SRDBINARY
|
||||
#include <ebcl/inline/SRDBinary.hh>
|
||||
#endif // _H_EBCL_SRDBINARY
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
/* SRD - DATA *****************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDDATA
|
||||
#define _H_LW_LIB_SRDDATA
|
||||
#include <lw/lib/Externals.hh>
|
||||
#include <lw/lib/Strings.hh>
|
||||
#include <lw/lib/Types.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDDATA
|
||||
#define _H_EBCL_SRDDATA
|
||||
#include <ebcl/Externals.hh>
|
||||
#include <ebcl/Strings.hh>
|
||||
#include <ebcl/Types.hh>
|
||||
namespace ebcl {
|
||||
|
||||
class T_Logger;
|
||||
|
||||
|
@ -206,9 +206,6 @@ class X_SRDErrors : public std::exception
|
|||
const T_SRDErrors errors;
|
||||
X_SRDErrors( T_SRDErrors const& errors );
|
||||
char const * what( ) const noexcept override;
|
||||
#ifndef LW_MINLIB
|
||||
void log( T_Logger& logger ) const;
|
||||
#endif // LW_MINLIB
|
||||
};
|
||||
|
||||
|
||||
|
@ -357,5 +354,5 @@ extern template class T_Array< T_SRDToken >;
|
|||
|
||||
|
||||
} // namespace
|
||||
#include <lw/lib/inline/SRDData.hh>
|
||||
#endif // _H_LW_LIB_SRDDATA
|
||||
#include <ebcl/inline/SRDData.hh>
|
||||
#endif // _H_EBCL_SRDDATA
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
/* SRD - PARSER DEFINITIONS ***************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDDEFINITIONS
|
||||
#define _H_LW_LIB_SRDDEFINITIONS
|
||||
#include <lw/lib/SRDData.hh>
|
||||
#include <lw/lib/HashTables.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDDEFINITIONS
|
||||
#define _H_EBCL_SRDDEFINITIONS
|
||||
#include <ebcl/SRDData.hh>
|
||||
#include <ebcl/HashTables.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= DEFINITION DATA ==========================================================*/
|
||||
|
@ -317,5 +317,5 @@ T_SRDInputRule::T_SetContextExecutor OnExit( F_SRDHandler f );
|
|||
|
||||
|
||||
} // namespace
|
||||
#include <lw/lib/inline/SRDDefinitions.hh>
|
||||
#endif // _H_LW_LIB_SRDDEFINITIONS
|
||||
#include <ebcl/inline/SRDDefinitions.hh>
|
||||
#endif // _H_EBCL_SRDDEFINITIONS
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - INPUT AND OUTPUT *****************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDIO
|
||||
#define _H_LW_LIB_SRDIO
|
||||
#include <lw/lib/SRDData.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDIO
|
||||
#define _H_EBCL_SRDIO
|
||||
#include <ebcl/SRDData.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= INPUT / OUTPUT ABSTRACTIONS ==============================================*/
|
||||
|
@ -183,5 +183,5 @@ M_CLASS_POINTERS( SRDWriterTarget );
|
|||
|
||||
|
||||
} // namespace
|
||||
#include <lw/lib/inline/SRDIO.hh>
|
||||
#endif // _H_LW_LIB_SRDIO
|
||||
#include <ebcl/inline/SRDIO.hh>
|
||||
#endif // _H_EBCL_SRDIO
|
||||
|
|
|
@ -1,101 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* SRD - PREPROCESSOR COMMANDS ************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDPPCOMMANDS
|
||||
#define _H_LW_LIB_SRDPPCOMMANDS
|
||||
#include <lw/lib/SRDPreproc.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Add ); M_SRDPP_COMMAND_INIT( Add , "add" );
|
||||
M_SRDPP_COMMAND_DECL( And ); M_SRDPP_COMMAND_INIT( And , "and" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Bless ); M_SRDPP_COMMAND_INIT( Bless , "bless" );
|
||||
M_SRDPP_COMMAND_DECL( Break ); M_SRDPP_COMMAND_INIT( Break , "break" );
|
||||
M_SRDPP_COMMAND_DECL( BwAnd ); M_SRDPP_COMMAND_INIT( BwAnd , "bw-and" );
|
||||
M_SRDPP_COMMAND_DECL( BwNot ); M_SRDPP_COMMAND_INIT( BwNot , "bw-not" );
|
||||
M_SRDPP_COMMAND_DECL( BwOr ); M_SRDPP_COMMAND_INIT( BwOr , "bw-or" );
|
||||
M_SRDPP_COMMAND_DECL( BwXor ); M_SRDPP_COMMAND_INIT( BwXor , "bw-xor" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Call ); M_SRDPP_COMMAND_INIT( Call , "call" );
|
||||
M_SRDPP_COMMAND_DECL( CastString ); M_SRDPP_COMMAND_INIT( CastString , "to-string" );
|
||||
M_SRDPP_COMMAND_DECL( CastWord ); M_SRDPP_COMMAND_INIT( CastWord , "to-word" );
|
||||
M_SRDPP_COMMAND_DECL( CastInt ); M_SRDPP_COMMAND_INIT( CastInt , "to-integer" );
|
||||
M_SRDPP_COMMAND_DECL( CastLong ); M_SRDPP_COMMAND_INIT( CastLong , "to-long" );
|
||||
M_SRDPP_COMMAND_DECL( CastBestInt ); M_SRDPP_COMMAND_INIT( CastBestInt , "to-best-integer" );
|
||||
M_SRDPP_COMMAND_DECL( CastReal ); M_SRDPP_COMMAND_INIT( CastReal , "to-real" );
|
||||
M_SRDPP_COMMAND_DECL( CastVar ); M_SRDPP_COMMAND_INIT( CastVar , "to-variable" );
|
||||
M_SRDPP_COMMAND_DECL( CastList ); M_SRDPP_COMMAND_INIT( CastList , "to-list" );
|
||||
M_SRDPP_COMMAND_DECL( ClearScope ); M_SRDPP_COMMAND_INIT_N( ClearScope , "clear-scope" , 0 );
|
||||
M_SRDPP_COMMAND_DECL( Cmp ); M_SRDPP_COMMAND_INIT( Cmp , "cmp" );
|
||||
M_SRDPP_COMMAND_DECL( CmpEq ); M_SRDPP_COMMAND_INIT( CmpEq , "eq" );
|
||||
M_SRDPP_COMMAND_DECL( CmpNe ); M_SRDPP_COMMAND_INIT( CmpNe , "ne" );
|
||||
M_SRDPP_COMMAND_DECL( CmpLt ); M_SRDPP_COMMAND_INIT( CmpLt , "lt" );
|
||||
M_SRDPP_COMMAND_DECL( CmpGt ); M_SRDPP_COMMAND_INIT( CmpGt , "gt" );
|
||||
M_SRDPP_COMMAND_DECL( CmpLe ); M_SRDPP_COMMAND_INIT( CmpLe , "le" );
|
||||
M_SRDPP_COMMAND_DECL( CmpGe ); M_SRDPP_COMMAND_INIT( CmpGe , "ge" );
|
||||
M_SRDPP_COMMAND_DECL( Concat ); M_SRDPP_COMMAND_INIT( Concat , "concat" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Div ); M_SRDPP_COMMAND_INIT( Div , "div" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( EndsWith ); M_SRDPP_COMMAND_INIT( EndsWith , "ends-with" );
|
||||
M_SRDPP_COMMAND_DECL( Eval ); M_SRDPP_COMMAND_INIT( Eval , "eval" );
|
||||
M_SRDPP_COMMAND_DECL( Error ); M_SRDPP_COMMAND_INIT( Error , "error" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( FromSource ); M_SRDPP_COMMAND_INIT( FromSource , "from-source" );
|
||||
M_SRDPP_COMMAND_DECL( FromSRB ); M_SRDPP_COMMAND_INIT( FromSRB , "from-srb" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Get ); M_SRDPP_COMMAND_INIT( Get , "get" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( If ); M_SRDPP_COMMAND_INIT_N( If , "if" , 1 );
|
||||
M_SRDPP_COMMAND_DECL( Ignore ); M_SRDPP_COMMAND_INIT_N( Ignore , "ignore" , 0 );
|
||||
M_SRDPP_COMMAND_DECL( IsBlessed ); M_SRDPP_COMMAND_INIT( IsBlessed , "is-blessed" );
|
||||
M_SRDPP_COMMAND_DECL( IsMacro ); M_SRDPP_COMMAND_INIT( IsMacro , "is-macro" );
|
||||
M_SRDPP_COMMAND_DECL( IsSet ); M_SRDPP_COMMAND_INIT( IsSet , "is-set" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Length ); M_SRDPP_COMMAND_INIT( Length , "length" );
|
||||
M_SRDPP_COMMAND_DECL( ListMacros ); M_SRDPP_COMMAND_INIT_N( ListMacros , "ls-macros" , 0 );
|
||||
M_SRDPP_COMMAND_DECL( ListVariables ); M_SRDPP_COMMAND_INIT_N( ListVariables , "ls-variables" , 0 );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Mod ); M_SRDPP_COMMAND_INIT( Mod , "mod" );
|
||||
M_SRDPP_COMMAND_DECL( Mul ); M_SRDPP_COMMAND_INIT( Mul , "mul" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Neg ); M_SRDPP_COMMAND_INIT( Neg , "neg" );
|
||||
M_SRDPP_COMMAND_DECL( Not ); M_SRDPP_COMMAND_INIT( Not , "not" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Or ); M_SRDPP_COMMAND_INIT( Or , "or" );
|
||||
M_SRDPP_COMMAND_DECL( Output ); M_SRDPP_COMMAND_INIT( Output , "output" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Raw ); M_SRDPP_COMMAND_INIT_N( Raw , "raw" , 0 );
|
||||
M_SRDPP_COMMAND_DECL( Rethrow ); M_SRDPP_COMMAND_INIT( Rethrow , "rethrow" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Scope ); M_SRDPP_COMMAND_INIT_N( Scope , "scope" , 0 );
|
||||
M_SRDPP_COMMAND_DECL( Set ); M_SRDPP_COMMAND_INIT( Set , "set" );
|
||||
M_SRDPP_COMMAND_DECL( SetMacro ); M_SRDPP_COMMAND_INIT( SetMacro , "set-macro" );
|
||||
M_SRDPP_COMMAND_DECL( StartsWith ); M_SRDPP_COMMAND_INIT( StartsWith , "starts-with" );
|
||||
M_SRDPP_COMMAND_DECL( StrFind ); M_SRDPP_COMMAND_INIT( StrFind , "str-find" );
|
||||
M_SRDPP_COMMAND_DECL( StrSplit ); M_SRDPP_COMMAND_INIT( StrSplit , "str-split" );
|
||||
M_SRDPP_COMMAND_DECL( Sub ); M_SRDPP_COMMAND_INIT( Sub , "sub" );
|
||||
M_SRDPP_COMMAND_DECL( Substr ); M_SRDPP_COMMAND_INIT( Substr , "substr" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( ToSource ); M_SRDPP_COMMAND_INIT( ToSource , "to-source" );
|
||||
M_SRDPP_COMMAND_DECL( Try ); M_SRDPP_COMMAND_INIT_N( Try , "try" , 0 );
|
||||
M_SRDPP_COMMAND_DECL( TypeOf ); M_SRDPP_COMMAND_INIT( TypeOf , "type-of" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Unset ); M_SRDPP_COMMAND_INIT( Unset , "unset" );
|
||||
M_SRDPP_COMMAND_DECL( UnsetMacro ); M_SRDPP_COMMAND_INIT( UnsetMacro , "unset-macro" );
|
||||
M_SRDPP_COMMAND_DECL( Unwrap ); M_SRDPP_COMMAND_INIT( Unwrap , "unwrap" );
|
||||
|
||||
M_SRDPP_COMMAND_DECL_OBJ( VFSList , T_VFS& , vfs_ );
|
||||
M_SRDPP_COMMAND_INIT_OBJ( VFSList , "vfs-list" , T_VFS& , vfs_ );
|
||||
M_SRDPP_COMMAND_DECL_OBJ( VFSLoad , T_VFS& , vfs_ );
|
||||
M_SRDPP_COMMAND_INIT_OBJ( VFSLoad , "vfs-load" , T_VFS& , vfs_ );
|
||||
M_SRDPP_COMMAND_DECL_OBJ( VFSType , T_VFS& , vfs_ );
|
||||
M_SRDPP_COMMAND_INIT_OBJ( VFSType , "vfs-type" , T_VFS& , vfs_ );
|
||||
|
||||
M_SRDPP_COMMAND_DECL( Xor ); M_SRDPP_COMMAND_INIT( Xor , "xor" );
|
||||
|
||||
|
||||
} // namespace lw
|
||||
#endif // _H_LW_LIB_SRDPPCOMMANDS
|
|
@ -1,11 +1,12 @@
|
|||
/******************************************************************************/
|
||||
/* SRD PARSER AND PREPROCESSOR ************************************************/
|
||||
/* SRD PARSER *****************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include <lw/lib/SRDIO.hh>
|
||||
#include <lw/lib/SRDParserConfig.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDPARSER
|
||||
#define _H_EBCL_SRDPARSER
|
||||
#include <ebcl/SRDIO.hh>
|
||||
#include <ebcl/SRDParserConfig.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
// T_SRDParserData - Run-time data passed to the handlers when parsing
|
||||
|
@ -88,3 +89,4 @@ inline T const& T_SRDParser::getData( ) const
|
|||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_EBCL_SRDPARSER
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
/* SRD - PARSER CONFIGURATION *************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDPARSERCONFIG
|
||||
#define _H_LW_LIB_SRDPARSERCONFIG
|
||||
#include <lw/lib/SRDDefinitions.hh>
|
||||
#include <lw/lib/Types.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDPARSERCONFIG
|
||||
#define _H_EBCL_SRDPARSERCONFIG
|
||||
#include <ebcl/SRDDefinitions.hh>
|
||||
#include <ebcl/Types.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= PROCESSED PARSER CONFIGURATION ===========================================*/
|
||||
|
@ -95,5 +95,5 @@ class X_SRDParserConfig : public std::exception
|
|||
|
||||
|
||||
} // namespace
|
||||
#include <lw/lib/inline/SRDParserConfig.hh>
|
||||
#endif // _H_LW_LIB_SRDPARSERCONFIG
|
||||
#include <ebcl/inline/SRDParserConfig.hh>
|
||||
#endif // _H_EBCL_SRDPARSERCONFIG
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - TEXT STORAGE *********************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_SRDTEXT
|
||||
#define _H_LW_LIB_SRDTEXT
|
||||
#include <lw/lib/SRDIO.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_SRDTEXT
|
||||
#define _H_EBCL_SRDTEXT
|
||||
#include <ebcl/SRDIO.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= READER ===================================================================*/
|
||||
|
@ -89,5 +89,5 @@ void SRDWriteAsText( A_OutputStream& output , T_SRDList const& data );
|
|||
|
||||
|
||||
} // namespace
|
||||
#include <lw/lib/inline/SRDText.hh>
|
||||
#endif // _H_LW_LIB_SRDTEXT
|
||||
#include <ebcl/inline/SRDText.hh>
|
||||
#endif // _H_EBCL_SRDTEXT
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* VERSION NUMBERS ************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_VERSION
|
||||
#define _H_LW_LIB_VERSION
|
||||
#include <lw/lib/Externals.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
static constexpr inline uint32_t LibVersion( )
|
||||
{ return 0; }
|
||||
|
||||
static constexpr inline uint32_t LibRevision( )
|
||||
{ return 0; }
|
||||
|
||||
|
||||
}
|
||||
#endif // _H_LW_LIB_VERSION
|
|
@ -1,19 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* VERSION NUMBERS ************************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_VERSION
|
||||
#define _H_LW_LIB_VERSION
|
||||
#include <lw/lib/Externals.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
static constexpr inline uint32_t LibVersion( )
|
||||
{ return __VERSION__; }
|
||||
|
||||
static constexpr inline uint32_t LibRevision( )
|
||||
{ return __REVISION__; }
|
||||
|
||||
|
||||
}
|
||||
#endif // _H_LW_LIB_VERSION
|
|
@ -2,11 +2,11 @@
|
|||
/* DYNAMIC LIBRARIES - INLINE CODE ********************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_DYNLIB
|
||||
#define _H_LW_LIB_INLINE_DYNLIB
|
||||
#ifndef _H_EBCL_INLINE_DYNLIB
|
||||
#define _H_EBCL_INLINE_DYNLIB
|
||||
|
||||
#include <lw/lib/DynLib.hh>
|
||||
namespace lw {
|
||||
#include <ebcl/DynLib.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= T_DynLib =================================================================*/
|
||||
|
@ -27,4 +27,4 @@ inline std::function< T > T_DynLib::getFunction(
|
|||
|
||||
|
||||
}
|
||||
#endif // _H_LW_LIB_INLINE_DYNLIB
|
||||
#endif // _H_EBCL_INLINE_DYNLIB
|
||||
|
|
|
@ -1,154 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* UI<=>GAME MESSAGES - INLINE CODE *******************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_MESSAGES
|
||||
#define _H_LW_LIB_INLINE_MESSAGES
|
||||
#include <lw/lib/GameLoop.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
/*= T_ProgressInfoPart =======================================================*/
|
||||
|
||||
inline T_ProgressInfoPart::T_ProgressInfoPart( T_String text ,
|
||||
uint32_t progress , uint32_t total ) noexcept
|
||||
: text_( std::move( text ) ) , progress_( progress ) , total_( total )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfoPart::T_ProgressInfoPart( T_ProgressInfoPart&& other ) noexcept
|
||||
: text_( std::move( other.text_ ) ) , progress_( other.progress_ ) ,
|
||||
total_( other.total_ )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfoPart::T_ProgressInfoPart( T_ProgressInfoPart const& other )
|
||||
: text_( other.text_ ) , progress_( other.progress_ ) , total_( other.total_ )
|
||||
{ }
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
inline T_String const& T_ProgressInfoPart::text( ) const noexcept
|
||||
{
|
||||
return text_;
|
||||
}
|
||||
|
||||
inline uint32_t T_ProgressInfoPart::progress( ) const noexcept
|
||||
{
|
||||
return progress_;
|
||||
}
|
||||
|
||||
inline uint32_t T_ProgressInfoPart::total( ) const noexcept
|
||||
{
|
||||
return total_;
|
||||
}
|
||||
|
||||
|
||||
/*= T_ProgressInfo ===========================================================*/
|
||||
|
||||
inline T_ProgressInfo::T_ProgressInfo( T_String text , uint32_t progress , uint32_t total ) noexcept
|
||||
: main_( std::move( text ) , progress , total ) , sub_( )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfo::T_ProgressInfo( T_ProgressInfoPart main ) noexcept
|
||||
: main_( std::move( main ) )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfo::T_ProgressInfo(
|
||||
T_ProgressInfoPart main ,
|
||||
T_ProgressInfoPart sub ) noexcept
|
||||
: main_( std::move( main ) ) ,
|
||||
sub_( std::move( sub ) )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfo::T_ProgressInfo( T_ProgressInfoPart main ,
|
||||
T_String sText , uint32_t sProgress , uint32_t sTotal ) noexcept
|
||||
: main_( std::move( main ) ) ,
|
||||
sub_( T_ProgressInfoPart{ std::move( sText ) , sProgress , sTotal } )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfo::T_ProgressInfo( T_String text , uint32_t progress , uint32_t total ,
|
||||
T_String sText , uint32_t sProgress , uint32_t sTotal ) noexcept
|
||||
: main_( std::move( text ) , progress , total ) ,
|
||||
sub_( T_ProgressInfoPart{ std::move( sText ) , sProgress , sTotal } )
|
||||
{ }
|
||||
|
||||
inline T_ProgressInfo::T_ProgressInfo( T_ProgressInfo&& other ) noexcept
|
||||
: main_( std::move( other.main_ ) ) , sub_( std::move( other.sub_ ) )
|
||||
{ }
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
inline T_ProgressInfoPart const& T_ProgressInfo::main( ) const noexcept
|
||||
{
|
||||
return main_;
|
||||
}
|
||||
|
||||
inline bool T_ProgressInfo::hasSub( ) const noexcept
|
||||
{
|
||||
return sub_.present( );
|
||||
}
|
||||
|
||||
inline T_ProgressInfoPart const& T_ProgressInfo::sub( ) const
|
||||
{
|
||||
return (T_ProgressInfoPart const&) sub_;
|
||||
}
|
||||
|
||||
|
||||
/*= T_GameMessage ============================================================*/
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline constexpr T_GameMessage< D , MT , MD >::T_GameMessage( ) noexcept
|
||||
: type_( ) , data_( )
|
||||
{ }
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline constexpr T_GameMessage< D , MT , MD >::T_GameMessage(
|
||||
T_Type type ) noexcept
|
||||
: type_( type ) , data_( )
|
||||
{ }
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline T_GameMessage< D , MT , MD >::T_GameMessage(
|
||||
T_Type type ,
|
||||
T_Data data ) noexcept
|
||||
: type_( type ) , data_( data )
|
||||
{ }
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline T_GameMessage< D , MT , MD >::T_GameMessage(
|
||||
T_Self_&& other ) noexcept
|
||||
: type_( other.type_ ) , data_( std::move( other.data_ ) )
|
||||
{ }
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline T_GameMessage< D >& T_GameMessage< D , MT , MD >::operator =(
|
||||
T_Self_&& other ) noexcept
|
||||
{
|
||||
type_ = other.type_;
|
||||
data_ = std::move( other.data_ );
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline constexpr bool T_GameMessage< D , MT , MD >::hasMessage( ) const noexcept
|
||||
{
|
||||
return type_.present( );
|
||||
}
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
inline constexpr MT T_GameMessage< D , MT , MD >::type( ) const noexcept
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
template< E_MessageDirection D , typename MT , typename MD >
|
||||
template< typename T >
|
||||
constexpr T const& T_GameMessage< D , MT , MD >::data( ) const
|
||||
{
|
||||
return (T const&)( (MD const&) data_ );
|
||||
}
|
||||
|
||||
|
||||
} // namespace lw
|
||||
#endif // _H_LW_LIB_INLINE_MESSAGES
|
|
@ -1,59 +0,0 @@
|
|||
/******************************************************************************/
|
||||
/* MODDING SYSTEM - INLINE CODE ***********************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_MODS
|
||||
#define _H_LW_LIB_INLINE_MODS
|
||||
#include <lw/lib/Mods.hh>
|
||||
namespace lw {
|
||||
|
||||
|
||||
/*= T_ModIdentifier ==========================================================*/
|
||||
|
||||
inline bool T_ModIdentifier::operator ==(
|
||||
T_ModIdentifier const& other ) const noexcept
|
||||
{
|
||||
return &other == this || ( name == other.name
|
||||
&& version == other.version );
|
||||
}
|
||||
|
||||
inline bool T_ModIdentifier::operator !=(
|
||||
T_ModIdentifier const& other ) const noexcept
|
||||
{
|
||||
return &other != this && ( name != other.name
|
||||
|| version != other.version );
|
||||
}
|
||||
|
||||
inline M_DEFINE_HASH( T_ModIdentifier )
|
||||
{
|
||||
return ComputeHash( item.name ) * 47 + item.version;
|
||||
}
|
||||
|
||||
inline M_DEFINE_COMPARATOR( T_ModIdentifier )
|
||||
{
|
||||
return a.compare( b );
|
||||
}
|
||||
|
||||
inline M_LSHIFT_OP( T_StringBuilder , T_ModIdentifier const& )
|
||||
{
|
||||
obj << value.name << ':' << value.version;
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
/*= T_ModInfo ================================================================*/
|
||||
|
||||
inline bool T_ModInfo::isUserInterface( ) const noexcept
|
||||
{
|
||||
return type == E_ModType::UI;
|
||||
}
|
||||
|
||||
inline M_LSHIFT_OP( T_StringBuilder , T_ModInfo const& )
|
||||
{
|
||||
obj << value.identifier << '.' << value.revision;
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif // _H_LW_LIB_INLINE_MODS
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - BINARY STORAGE - INLINE CODE *****************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_SRDBINARY
|
||||
#define _H_LW_LIB_INLINE_SRDBINARY
|
||||
#include <lw/lib/SRDBinary.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_INLINE_SRDBINARY
|
||||
#define _H_EBCL_INLINE_SRDBINARY
|
||||
#include <ebcl/SRDBinary.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
inline void SRDBinaryWriteTo( A_OutputStream& output , T_SRDList const& data )
|
||||
|
@ -30,4 +30,4 @@ inline T_SRDList SRDBinaryReadFrom( T_String const& name , A_InputStream& input
|
|||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_LW_LIB_INLINE_SRDBINARY
|
||||
#endif // _H_EBCL_INLINE_SRDBINARY
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - DATA - INLINE CODE ***************************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_SRDDATA
|
||||
#define _H_LW_LIB_INLINE_SRDDATA
|
||||
#include <lw/lib/SRDData.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_INLINE_SRDDATA
|
||||
#define _H_EBCL_INLINE_SRDDATA
|
||||
#include <ebcl/SRDData.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= T_SRDLocationChaining ====================================================*/
|
||||
|
@ -435,4 +435,4 @@ inline T_SRDLocation const& T_SRDToken::location( ) const noexcept
|
|||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_LW_LIB_INLINE_SRDDATA
|
||||
#endif // _H_EBCL_INLINE_SRDDATA
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - PARSER DEFINITIONS - INLINE CODE *************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_SRDDEFINITIONS
|
||||
#define _H_LW_LIB_INLINE_SRDDEFINITIONS
|
||||
#include <lw/lib/SRDDefinitions.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_INLINE_SRDDEFINITIONS
|
||||
#define _H_EBCL_INLINE_SRDDEFINITIONS
|
||||
#include <ebcl/SRDDefinitions.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= T_SRDEnum ================================================================*/
|
||||
|
@ -522,4 +522,4 @@ inline T_SRDInputRule::T_SetContextExecutor OnExit( F_SRDHandler f )
|
|||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_LW_LIB_INLINE_SRDDEFINITIONS
|
||||
#endif // _H_EBCL_INLINE_SRDDEFINITIONS
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - INPUT AND OUTPUT - INLINE CODE ***************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_SRDIO
|
||||
#define _H_LW_LIB_INLINE_SRDIO
|
||||
#include <lw/lib/SRDIO.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_INLINE_SRDIO
|
||||
#define _H_EBCL_INLINE_SRDIO
|
||||
#include <ebcl/SRDIO.hh>
|
||||
namespace ebcl {
|
||||
|
||||
/*= A_SRDWriter ==============================================================*/
|
||||
|
||||
|
@ -77,4 +77,4 @@ inline bool T_SRDMemoryTarget::complete( ) const
|
|||
} // namespace
|
||||
|
||||
|
||||
#endif // _H_LW_LIB_INLINE_SRDIO
|
||||
#endif // _H_EBCL_INLINE_SRDIO
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - PARSER CONFIGURATION - INLINE CODE ***********************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_SRDPARSERCONFIG
|
||||
#define _H_LW_LIB_INLINE_SRDPARSERCONFIG
|
||||
#include <lw/lib/SRDParserConfig.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_INLINE_SRDPARSERCONFIG
|
||||
#define _H_EBCL_INLINE_SRDPARSERCONFIG
|
||||
#include <ebcl/SRDParserConfig.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
/*= T_SRDTransition ==========================================================*/
|
||||
|
@ -30,4 +30,4 @@ inline T_Optional< uint32_t > T_SRDParserConfig::enumValue(
|
|||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_LW_LIB_INLINE_SRDPARSERCONFIG
|
||||
#endif // _H_EBCL_INLINE_SRDPARSERCONFIG
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
/* SRD - TEXT STORAGE - INLINE CODE *******************************************/
|
||||
/******************************************************************************/
|
||||
|
||||
#ifndef _H_LW_LIB_INLINE_SRDTEXT
|
||||
#define _H_LW_LIB_INLINE_SRDTEXT
|
||||
#include <lw/lib/SRDText.hh>
|
||||
namespace lw {
|
||||
#ifndef _H_EBCL_INLINE_SRDTEXT
|
||||
#define _H_EBCL_INLINE_SRDTEXT
|
||||
#include <ebcl/SRDText.hh>
|
||||
namespace ebcl {
|
||||
|
||||
|
||||
inline void SRDWriteAsText( A_OutputStream& output , T_SRDList const& data )
|
||||
|
@ -22,4 +22,4 @@ inline T_SRDTextReader::T_SRDTextReader( A_SRDReaderTarget& target )
|
|||
|
||||
|
||||
} // namespace
|
||||
#endif // _H_LW_LIB_INLINE_SRDTEXT
|
||||
#endif // _H_EBCL_INLINE_SRDTEXT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue