Library: uniform definition scheme for error-IDs

In the Lumiera code base, we use C-String constants as unique error-IDs.
Basically this allows to create new unique error IDs anywhere in the code.

However, definition of such IDs in arbitrary namespaces tends to create
slight confusion and ambiguities, while maintaining the proper use statements
requires some manual work.

Thus I introduce a new **standard scheme**
 * Error-IDs for widespread use shall be defined _exclusively_ into `namespace lumiera::error`
 * The shorthand-Macro `LERR_()` can now be used to simplify inclusion and referral
 * (for local or single-usage errors, a local or even hidden definition is OK)
This commit is contained in:
Fischlurch 2024-03-16 02:04:47 +01:00
parent 59390cd2f8
commit a90b9e5f16
120 changed files with 499 additions and 498 deletions

View file

@ -508,8 +508,8 @@ namespace advice {
: error::Fatal
{
SelfCheckFailure (Literal failure)
: error::Fatal (string("Failed test: ")+failure
,LERR_(INDEX_CORRUPTED))
: error::Fatal {string("Failed test: ")+failure
,LUMIERA_ERROR_INDEX_CORRUPTED}
{ }
};
}

View file

@ -72,9 +72,13 @@
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (CAPABILITY_QUERY); ///< unresolvable capability query.
}
using std::string;
using lib::P;
/////////////////////////////////////////////////////////////////////TICKET #705 this is draft/preview code; a real resolution system needs to be integrated
@ -207,11 +211,6 @@ namespace lumiera {
// TODO: find out what operations we need to support here for the »real solution« (using Prolog)
};
LUMIERA_ERROR_DECLARE (CAPABILITY_QUERY); ///< unresolvable capability query.
} // namespace query

View file

@ -36,9 +36,11 @@ using lumiera::QueryKey;
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE (CAPABILITY_QUERY, "unresolvable capability query");
}
namespace query {
LUMIERA_ERROR_DEFINE (CAPABILITY_QUERY, "unresolvable capability query");
} // namespace query

View file

@ -53,7 +53,6 @@ using util::_Fmt;
using steam::ConfigResolver;
using lumiera::query::QueryHandler; ///////TODO preliminary interface defined in config-rules.hpp
using lumiera::query::LERR_(CAPABILITY_QUERY);
namespace lumiera{
@ -149,9 +148,9 @@ namespace query {
res = create (capabilities); // not yet known as default, create new
if (!res)
throw lumiera::error::Config (_Fmt("The following Query could not be resolved: %s.")
% capabilities.rebuild().asKey()
, LUMIERA_ERROR_CAPABILITY_QUERY );
throw error::Config (_Fmt("The following Query could not be resolved: %s.")
% capabilities.rebuild().asKey()
, LERR_(CAPABILITY_QUERY) );
else
return res;
}

View file

@ -55,8 +55,8 @@
#include "lib/symbol.hpp"
namespace lib {
namespace diff{
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE(DIFF_STRUCTURE); ///< Invalid diff structure: implicit rules and assumptions violated.
}}
namespace Glib {
@ -67,7 +67,7 @@ namespace stage {
//using lib::Literal;
using lib::Symbol;
//using cuString = const Glib::ustring;
using lib::diff::LERR_(DIFF_STRUCTURE);
using LERR_(DIFF_STRUCTURE);
extern const Symbol META_kind;

View file

@ -182,7 +182,7 @@ namespace lib {
creator_ = []() -> OBJ*
{
throw error::Fatal("Service not available at this point of the Application Lifecycle"
,error::LERR_(LIFECYCLE));
,LERR_(LIFECYCLE));
};
}

View file

@ -94,15 +94,17 @@
#include <tuple>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE(DIFF_STRUCTURE); ///< Invalid diff structure: implicit rules and assumptions violated.
LUMIERA_ERROR_DECLARE(DIFF_CONFLICT); ///< Collision in diff application: contents of target not as expected.
}}
namespace lib {
namespace diff{
namespace error = lumiera::error;
LUMIERA_ERROR_DECLARE(DIFF_STRUCTURE); ///< Invalid diff structure: implicit rules and assumptions violated.
LUMIERA_ERROR_DECLARE(DIFF_CONFLICT); ///< Collision in diff application: contents of target not as expected.
template<class I, typename E>
using HandlerFun = void (I::*) (E const&); // NOTE: element value taken by const&

View file

@ -35,13 +35,14 @@
#include "lib/diff/diff-language.hpp"
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE(DIFF_STRUCTURE, "Invalid diff structure: implicit rules and assumptions violated.");
LUMIERA_ERROR_DEFINE(DIFF_CONFLICT, "Collision in diff application: contents of target not as expected.");
}}
namespace lib {
namespace diff{
LUMIERA_ERROR_DEFINE(DIFF_STRUCTURE, "Invalid diff structure: implicit rules and assumptions violated.");
LUMIERA_ERROR_DEFINE(DIFF_CONFLICT, "Collision in diff application: contents of target not as expected.");
}} // namespace lib::diff

View file

@ -88,45 +88,45 @@ namespace diff{
void
TreeDiffMutatorBinding::__failMismatch (Literal oper, GenNode const& spec)
{
throw error::State(_Fmt("Unable to %s element %s. Current shape of target "
throw error::State{_Fmt("Unable to %s element %s. Current shape of target "
"data does not match expectations") % oper % spec
, LUMIERA_ERROR_DIFF_CONFLICT);
, LERR_(DIFF_CONFLICT)};
}
void
TreeDiffMutatorBinding::__expect_further_elements (GenNode const& elm)
{
if (not treeMutator_->hasSrc())
throw error::State(_Fmt("Premature end of target sequence, still expecting element %s; "
throw error::State{_Fmt("Premature end of target sequence, still expecting element %s; "
"unable to apply diff further.") % elm
, LUMIERA_ERROR_DIFF_CONFLICT);
, LERR_(DIFF_CONFLICT)};
}
void
TreeDiffMutatorBinding::__fail_not_found (GenNode const& elm)
{
throw error::State(_Fmt("Premature end of sequence; unable to locate "
"element %s in the remainder of the target.") % elm
, LUMIERA_ERROR_DIFF_CONFLICT);
throw error::State{_Fmt("Premature end of sequence; unable to locate "
"element %s in the remainder of the target.") % elm
, LERR_(DIFF_CONFLICT)};
}
void
TreeDiffMutatorBinding::__expect_end_of_scope (GenNode::ID const& idi)
{
if (not treeMutator_->completeScope())
throw error::State(_Fmt("Diff application floundered in nested scope %s; "
throw error::State{_Fmt("Diff application floundered in nested scope %s; "
"unexpected extra elements found when diff "
"should have settled everything.") % idi.getSym()
, LUMIERA_ERROR_DIFF_STRUCTURE);
, LERR_(DIFF_STRUCTURE)};
}
void
TreeDiffMutatorBinding::__expect_valid_parent_scope (GenNode::ID const& idi)
{
if (0 == scopeManger_->depth())
throw error::Fatal(_Fmt("Diff application floundered after leaving scope %s; "
throw error::Fatal{_Fmt("Diff application floundered after leaving scope %s; "
"unbalanced nested scopes, diff attempts to pop root.") % idi.getSym()
, LUMIERA_ERROR_DIFF_STRUCTURE);
, LERR_(DIFF_STRUCTURE)};
}

View file

@ -77,6 +77,7 @@ namespace lumiera {
LUMIERA_ERROR_DEFINE (FLAG , "non-cleared lumiera errorstate");
LUMIERA_ERROR_DEFINE (INVALID , "invalid input or parameters");
LUMIERA_ERROR_DEFINE (EXTERNAL , "failure in external service");
LUMIERA_ERROR_DEFINE (EXCEPTION, "generic Lumiera exception");
LUMIERA_ERROR_DEFINE (ASSERTION, "assertion failure");
/* some further generic error situations */
@ -92,8 +93,6 @@ namespace lumiera {
} // namespace error
LUMIERA_ERROR_DEFINE (EXCEPTION, "generic Lumiera exception");

View file

@ -49,16 +49,18 @@
#include <string>
#define LERR_(_NAME_) lumiera::error::LUMIERA_ERROR_##_NAME_
namespace lumiera {
using std::string;
using CStr = const char*;
namespace error {
/** error-ID for unspecified exceptions */
LUMIERA_ERROR_DECLARE(EXCEPTION);
}
#define LERR_(_NAME_) LUMIERA_ERROR_##_NAME_
/** error-ID for unspecified exceptions */
LUMIERA_ERROR_DECLARE(EXCEPTION);
/**
* Interface and Base definition for all Lumiera Exceptions.

View file

@ -71,7 +71,7 @@
namespace lib {
namespace error = lumiera::error;
using error::LERR_(INDEX_BOUNDS);
using LERR_(INDEX_BOUNDS);
using util::unConst;

View file

@ -94,8 +94,8 @@
namespace lib {
namespace error = lumiera::error;
using error::LERR_(BOTTOM_VALUE);
using error::LERR_(WRONG_TYPE);
using LERR_(BOTTOM_VALUE);
using LERR_(WRONG_TYPE);
using util::isSameObject;
using util::unConst;

View file

@ -36,7 +36,7 @@
namespace lib {
using lumiera::error::LERR_(BOTTOM_VALUE);
using LERR_(BOTTOM_VALUE);

View file

@ -82,8 +82,8 @@
namespace lib {
namespace error = lumiera::error;
using error::LERR_(CAPACITY);
using error::LERR_(INDEX_BOUNDS);
using LERR_(INDEX_BOUNDS);
using LERR_(CAPACITY);

View file

@ -40,9 +40,6 @@
namespace lib {
LUMIERA_ERROR_DEFINE (FILE_NOT_DIRECTORY, "path element points at a file instead of a directory");
using std::regex;
using std::regex_replace;

View file

@ -50,8 +50,7 @@ namespace lib {
namespace error = lumiera::error;
namespace fsys = boost::filesystem;
LUMIERA_ERROR_DECLARE (FILE_NOT_DIRECTORY); ///< path element points at a file instead of a directory
using error::LERR_(ITER_EXHAUST);
using LERR_(ITER_EXHAUST);
/** retrieve the location of the executable */

View file

@ -44,6 +44,11 @@
#include <string>
#include <bitset>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (INVALID_TIMECODE); ///< timecode format error, illegal value encountered.
}}
namespace lib {
namespace time {
@ -64,13 +69,11 @@ namespace time {
namespace format {
LUMIERA_ERROR_DECLARE (INVALID_TIMECODE); ///< timecode format error, illegal value encountered.
using std::string;
using lib::meta::NoInstance; // the following types are for metaprogramming only...
/**
/**
* Frame count as timecode format.
* An integral number used to count frames
* can be used as a simple from of time code.
@ -192,7 +195,7 @@ namespace time {
*/
class Supported
{
enum { MAXID = 8 };
enum { MAXID = 8 };
std::bitset<MAXID> flags_;

View file

@ -49,15 +49,17 @@ using std::smatch;
using std::regex_search;
using boost::lexical_cast;
namespace error = lumiera::error;
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE (INVALID_TIMECODE, "timecode format error, illegal value encountered");
}}
namespace lib {
namespace time {
namespace error = lumiera::error;
namespace format { /* ================= Timecode implementation details ======== */
namespace format { /* ================= Timecode implementation details ======== */
LUMIERA_ERROR_DEFINE (INVALID_TIMECODE, "timecode format error, illegal value encountered");
/** try to parse a frame number specification
@ -120,7 +122,7 @@ namespace time {
Seconds::parse (string const& seconds, QuantR grid)
{
static regex fracSecs_parser ("(?:^|[^\\./\\d\\-])(\\-?\\d+)(?:([\\-\\+]\\d+)?/(\\d+))?sec");
//__no leading[./-\d] number [+-] number '/' number 'sec'
//__no leading[./-\d] number [+-] number '/' number 'sec'
#define SUB_EXPR(N) lexical_cast<int> (match[N])
smatch match;
@ -152,7 +154,7 @@ namespace time {
/** build up a frame count
* by quantising the given time value
* by quantising the given time value
*/
void
Frames::rebuild (FrameNr& frameNr, QuantR quantiser, TimeValue const& rawTime)
@ -161,7 +163,7 @@ namespace time {
}
/** calculate the time point denoted by this frame count */
TimeValue
TimeValue
Frames::evaluate (FrameNr const& frameNr, QuantR quantiser)
{
return quantiser.timeOf (frameNr);
@ -182,7 +184,7 @@ namespace time {
/** calculate the time point denoted by this SMPTE timecode,
* by summing up the timecode's components */
TimeValue
TimeValue
Smpte::evaluate (SmpteTC const& tc, QuantR quantiser)
{
uint frameRate = tc.getFps();
@ -204,8 +206,8 @@ namespace time {
* it need to be the actual framerate used by the quantiser.
* Especially in case of NTSC drop-frame, the timecode
* uses 30fps here, while the quantisation uses 29.97
* @todo this design just doesn't feel quite right...
*/
* @todo this design just doesn't feel quite right...
*/
uint
Smpte::getFramerate (QuantR quantiser_, TimeValue const& rawTime)
{
@ -224,7 +226,7 @@ namespace time {
* 0:0:0:0 to 23:59:59:##. When this strategy function is invoked,
* the frames, seconds, minutes and hours fields have already been processed
* and stored into the component digxels, under the assumption the overall
* value stays in range.
* value stays in range.
* @note currently the range is extended "naturally" (i.e. mathematically).
* The representation is flipped around the zero point and the value
* of the hours is just allowed to increase beyond 23
@ -395,10 +397,10 @@ namespace time {
void
SmpteTC::invertOrientation()
{
int fr (getFps());
int fr (getFps());
int f (fr - frames); // revert orientation
int s (60 - secs); // of the components
int m (60 - mins); //
int m (60 - mins); //
int h = -hours; // assumed to be negative
sgn *= -1; // flip sign field
@ -408,7 +410,7 @@ namespace time {
hours.setValueRaw(h);
mins = m; // invoking setters
secs = s; // ensures normalisation
secs = s; // ensures normalisation
frames = f;
}
@ -459,14 +461,14 @@ namespace time {
/** */
int
HmsTC::getMins() const
HmsTC::getMins() const
{
return lumiera_time_minutes (tpoint_);
}
/** */
int
HmsTC::getHours() const
HmsTC::getHours() const
{
return lumiera_time_hours (tpoint_);
}

View file

@ -709,7 +709,7 @@ namespace time {
{
if (n == NUM{0})
throw error::Logic ("Degenerated frame grid not allowed"
, error::LERR_(BOTTOM_VALUE));
, LERR_(BOTTOM_VALUE));
return n;
}

View file

@ -356,7 +356,7 @@ namespace lib {
if (!buff)
throw error::Logic(indicateTypeMismatch(b)
,error::LERR_(WRONG_TYPE));
,LERR_(WRONG_TYPE));
else
return *buff;
}

View file

@ -58,7 +58,7 @@ namespace wrapper {
using util::unConst;
using util::isSameObject;
using lib::meta::_Fun;
using lumiera::error::LERR_(BOTTOM_VALUE);
using LERR_(BOTTOM_VALUE);
using std::function;

View file

@ -126,7 +126,7 @@ namespace ctrl {
if (-1 == typeID)
throw error::Invalid (_Fmt{"Requested type «%s» not usable as docking panel."}
% util::typeStr<PAN>()
,error::LERR_(WRONG_TYPE));
,LERR_(WRONG_TYPE));
return dynamic_cast<PAN&> (preliminary_impl_PanelLookup (typeID));
}

View file

@ -62,7 +62,7 @@ namespace ctrl {
{
if (not instance)
throw error::Logic ("GTK UI is not in running state"
, error::LERR_(LIFECYCLE));
, LERR_(LIFECYCLE));
return *instance;
}

View file

@ -120,7 +120,7 @@ namespace stage {
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
lib::Depend<DisplayService> _instance; ///< a backdoor for the C Language impl to access the actual SessionCommand implementation...

View file

@ -80,6 +80,12 @@
#endif
namespace lumiera {
namespace error {
/* some commonly used error marks for the UI... */
LUMIERA_ERROR_DECLARE (UIWIRING); // "GUI state contradicts assumptions in signal wiring"
}}
/* ======= Namespace Definitions ======= */
@ -90,9 +96,6 @@
*/
namespace stage {
/* some commonly used error marks for the UI... */
LUMIERA_ERROR_DECLARE (UIWIRING); // "GUI state contradicts assumptions in signal wiring"
/* widely used type abbreviations */
using uString = Glib::ustring;
using cuString = const uString;

View file

@ -73,10 +73,14 @@ using stage::LUMIERA_INTERFACE_INAME(lumieraorg_Gui, 1);
using std::string;
namespace stage {
namespace lumiera {
namespace error {
/* == definition common error marks for the UI, declared in gtk-base.hpp == */
LUMIERA_ERROR_DEFINE (UIWIRING, "GUI state contradicts assumptions in signal wiring");
}}
namespace stage {
namespace { // implementation details

View file

@ -69,7 +69,7 @@ using lib::hash::LuidH;
using lib::diff::Rec;
using lib::diff::TreeMutator;
using lib::diff::collection;
using lib::diff::LUMIERA_ERROR_DIFF_STRUCTURE;
using LERR_(DIFF_STRUCTURE);
using std::make_unique;
using util::toString;

View file

@ -240,7 +240,7 @@ namespace stage {
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
lib::Depend<NotificationService> _instance; ///< a backdoor for the C Language impl to access the actual SessionCommand implementation...

View file

@ -242,7 +242,7 @@ namespace asset {
"(multichannel) media. Found parent Media %s.")
% mediaref
% *mediaref.checkCompound()
,LERR_(PART_OF_COMPOUND));
,LUMIERA_ERROR_PART_OF_COMPOUND);
Clip* pC = new Clip (mediaref);
return AssetManager::instance().wrap (*pC);
}

View file

@ -70,7 +70,7 @@ namespace asset {
using util::isnil;
using util::contains;
using lumiera::Query;
using lumiera::query::LERR_(CAPABILITY_QUERY);
using LERR_(CAPABILITY_QUERY);
using lib::query::extractID;
using steam::mobject::Session;

View file

@ -45,14 +45,21 @@ using lib::Depend;
using lib::Sync;
namespace lumiera {
namespace error {
// ------pre-defined-common-error-cases---------------
LUMIERA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID");
LUMIERA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast");
}}
namespace steam {
namespace asset {
namespace error = lumiera::error;
/**
/**
* AssetManager error responses, caused by querying
* invalid Asset IDs from the internal DB.
*/
*/
struct IDErr
: error::Invalid
{
@ -60,10 +67,6 @@ namespace asset {
};
// ------pre-defined-common-error-cases---------------
//
LUMIERA_ERROR_DEFINE (UNKNOWN_ASSET_ID, "non-registered Asset ID");
LUMIERA_ERROR_DEFINE (WRONG_ASSET_KIND, "wrong Asset kind, unable to cast");
struct UnknownID : IDErr
{
@ -100,7 +103,7 @@ namespace asset {
/** provide the unique ID for given Asset::Ident tuple */
ID<Asset>
ID<Asset>
AssetManager::getID (const Asset::Ident& idi)
{
return asset::hash_value (idi);
@ -114,7 +117,7 @@ namespace asset {
* @throw error::Invalid in case of invalid identity spec
*/
template<class KIND>
ID<KIND>
ID<KIND>
AssetManager::reg (KIND* obj, const Asset::Ident& idi)
{
AssetManager& _aMang (AssetManager::instance());
@ -133,16 +136,16 @@ namespace asset {
/** @note the KIND of asset needs to be assignable by the actual stored asset
* @throw error::Invalid if nothing is found or if the actual KIND
* of the stored object differs and can't be casted.
* of the stored object differs and can't be casted.
*/
template<class KIND>
lib::P<KIND>
AssetManager::getAsset (const ID<KIND>& id)
AssetManager::getAsset (const ID<KIND>& id)
{
if (lib::P<KIND> obj = registry.get (id))
return obj;
else
if (known (id)) // provide Ident tuple of existing Asset
if (known (id)) // provide Ident tuple of existing Asset
throw WrongKind (registry.get(ID<Asset>(id))->ident);
else
throw UnknownID (id);
@ -151,14 +154,14 @@ namespace asset {
/** Convenience shortcut for fetching the registered smart-ptr
* which is in charge of the given asset instance. By querying
* directly asset.id (of type ID<Asset>), the call to registry.get()
* can bypass the dynamic cast, because the type of the asset
* is explicitly given by type KIND.
* can bypass the dynamic cast, because the type of the asset
* is explicitly given by type KIND.
*/
template<class KIND>
lib::P<KIND>
AssetManager::wrap (const KIND& asset)
{
ENSURE (instance().known(asset.id),
ENSURE (instance().known(asset.id),
"unregistered asset instance encountered.");
return static_pointer_cast<KIND,Asset>
(instance().registry.get (asset.id));
@ -173,7 +176,7 @@ namespace asset {
AssetManager::known (IDA id)
{
return bool(registry.get (ID<Asset>(id)));
} // query most general Asset ID-kind and use implicit
} // query most general Asset ID-kind and use implicit
// conversion from smart-ptr to bool (test if empty)
@ -190,13 +193,13 @@ namespace asset {
namespace { // details implementing AssetManager::remove
void
void
recursive_call (AssetManager* instance, PAsset& pA)
{
{
instance->remove (pA->getID());
}
function<void(PAsset&)>
function<void(PAsset&)>
detach_child_recursively () ///< @return a functor recursively invoking remove(child)
{
return bind( &recursive_call, &AssetManager::instance(), _1 );
@ -205,10 +208,10 @@ namespace asset {
/**
* remove the given asset from the internal DB
* <i>together with all its dependents</i>
* _together with all its dependents_
*/
void
AssetManager::remove (IDA id)
AssetManager::remove (IDA id)
{
PAsset asset = getAsset (id);
for_each (asset->dependants, detach_child_recursively());
@ -225,7 +228,7 @@ namespace asset {
}
list<PcAsset>
list<PcAsset>
AssetManager::listContent() const
{
list<PcAsset> res;

View file

@ -22,7 +22,7 @@
/** @file assetmanager.hpp
** Steam-Layer Interface: Asset Lookup and Organisation.
** Declares the AssetManager interface used to access individual
** Declares the AssetManager interface used to access individual
** Asset instances.
**
** These classes are placed into namespace asset and proc_interface.
@ -58,6 +58,13 @@ using std::string;
using std::list;
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID.
LUMIERA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast.
}}
namespace steam {
namespace asset {
@ -67,7 +74,7 @@ namespace asset {
/**
* Facade for the Asset subsystem
*/
class AssetManager
class AssetManager
: util::NonCopyable
{
asset::DB & registry;
@ -130,9 +137,6 @@ namespace asset {
};
LUMIERA_ERROR_DECLARE (UNKNOWN_ASSET_ID); ///< use of a non-registered Asset ID.
LUMIERA_ERROR_DECLARE (WRONG_ASSET_KIND); ///< Asset ID of wrong Asset kind, unable to cast.
}} // namespace steam::asset

View file

@ -34,16 +34,18 @@
#include "lib/error.hpp"
namespace steam {
namespace control {
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (INVALID_ARGUMENTS); ///< Arguments provided for binding doesn't match stored command function parameters
LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS); ///< Command functor not yet usable, because arguments aren't bound
}}
namespace steam {
namespace control {
namespace err = lumiera::error;
/**
/**
* Adapter interface for invoking an argument binding for a command
* \em without the need to disclose the concrete types and number of arguments.
* At the receiver side, the concrete type can be restored by a dynamic cast.
@ -51,7 +53,7 @@ namespace control {
* usually this receiver will be an implementation object, whose exact
* type has been erased after definition, while the implementation
* internally of course knows the type and thus can perform an
* dynamic cast on the passed on argument tuple
* dynamic cast on the passed on argument tuple
*/
struct Arguments;
@ -65,13 +67,12 @@ namespace control {
template<typename TUP>
TUP const&
get ()
get()
{
TypedArguments<TUP>* dest = dynamic_cast<TypedArguments<TUP>*> (this);
if (!dest)
throw lumiera::error::Invalid("Wrong type or number of arguments"
, LUMIERA_ERROR_INVALID_ARGUMENTS);
if (not dest)
throw err::Invalid{"Wrong type or number of arguments"
, LERR_(INVALID_ARGUMENTS)};
return dest->args_;
}
};
@ -90,6 +91,5 @@ namespace control {
}} // namespace steam::control
#endif

View file

@ -76,8 +76,6 @@
#include <string>
namespace steam {
namespace control {
@ -88,9 +86,6 @@ namespace control {
LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS); ///< Command functor not yet usable, because arguments aren't bound
/**
* A neutral container internally holding
* the functor used to implement the Command

View file

@ -53,7 +53,7 @@
namespace steam {
namespace control {
namespace err = lumiera::error;
/**
@ -79,8 +79,8 @@ namespace control {
operator() (CmdClosure& clo)
{
if (!clo)
throw lumiera::error::State ("Lifecycle error: function arguments not ready",
LERR_(UNBOUND_ARGUMENTS));
throw err::State{"Lifecycle error: function arguments not ready"
, LERR_(UNBOUND_ARGUMENTS)};
clo.invoke (func_);
}
};
@ -122,8 +122,8 @@ namespace control {
captureState (CmdClosure& clo)
{
if (!clo)
throw lumiera::error::State ("need additional function arguments to be able to capture UNDO state",
LERR_(UNBOUND_ARGUMENTS));
throw err::State{"need additional function arguments to be able to capture UNDO state"
, LERR_(UNBOUND_ARGUMENTS)};
captureMemento_(clo);
return *this;

View file

@ -122,7 +122,7 @@ namespace control {
{
if (not definitionBlock)
throw error::Invalid ("unbound function/closure provided for CommandSetup"
, error::LERR_(BOTTOM_VALUE));
, LERR_(BOTTOM_VALUE));
pendingCmdDefinitions().emplace_front (cmdID_, move(definitionBlock));
return *this;
@ -219,7 +219,7 @@ namespace control {
if (not entry->second)
throw error::Logic (_Fmt{"Command instance '%s' is not (yet/anymore) active"}
% instanceID
, error::LERR_(LIFECYCLE));
, LERR_(LIFECYCLE));
return entry->second;
}
@ -245,7 +245,7 @@ namespace control {
if (not entry->second.isValid())
throw error::Logic (_Fmt{"Command instance '%s' is not (yet/anymore) active"}
% instanceID
, error::LERR_(LIFECYCLE));
, LERR_(LIFECYCLE));
if (not must_be_bound or entry->second.canExec())
instance = move(entry->second);
}

View file

@ -55,6 +55,11 @@
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS); ///< Command functor not yet usable, because arguments aren't bound
LUMIERA_ERROR_DECLARE (MISSING_MEMENTO); ///< Undo functor not yet usable, because no undo state has been captured
}}
namespace steam {
namespace control {

View file

@ -56,6 +56,7 @@
namespace steam {
namespace control {
namespace err = lumiera::error;
using lib::InPlaceBuffer;
using std::string;
@ -136,9 +137,9 @@ namespace control {
invoke (CmdFunctor const& func) override
{
if (!isValid())
throw lumiera::error::State ("Lifecycle error: can't bind functor, "
"command arguments not yet provided",
LERR_(UNBOUND_ARGUMENTS));
throw err::State{"Lifecycle error: can't bind functor, "
"command arguments not yet provided"
, LERR_(UNBOUND_ARGUMENTS)};
arguments_->invoke(func);
}

View file

@ -56,6 +56,7 @@
namespace steam {
namespace control {
namespace err = lumiera::error;
using lib::InPlaceBuffer;
using std::string;
@ -143,9 +144,9 @@ namespace control {
invoke (CmdFunctor const& func) override
{
if (!isValid())
throw lumiera::error::State ("Lifecycle error: can't bind functor, "
"command arguments not yet provided",
LERR_(UNBOUND_ARGUMENTS));
throw err::State{"Lifecycle error: can't bind functor, "
"command arguments not yet provided"
, LERR_(UNBOUND_ARGUMENTS)};
arguments_->invoke(func);
}

View file

@ -60,15 +60,18 @@ using std::move;
using util::_Fmt;
namespace steam {
namespace control {
namespace error = lumiera::error;
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE (INVALID_COMMAND, "Unknown or insufficiently defined command");
LUMIERA_ERROR_DEFINE (DUPLICATE_COMMAND, "Attempt to redefine an already existing command definition");
LUMIERA_ERROR_DEFINE (INVALID_ARGUMENTS, "Arguments provided for binding doesn't match stored command function parameters");
LUMIERA_ERROR_DEFINE (UNBOUND_ARGUMENTS, "Command mutation functor not yet usable, because arguments aren't bound");
LUMIERA_ERROR_DEFINE (MISSING_MEMENTO, "Undo functor not yet usable, because no undo state has been captured");
}}
namespace steam {
namespace control {
namespace error = lumiera::error;
namespace { // some common error checks...
@ -116,7 +119,7 @@ namespace control {
/** Access existing command for use.
* @throw error::Invalid if command not
* @throw error::Invalid if command not
* registered or incompletely defined.
* @remark this function deliberately returns by-value.
* Returning a reference into the global CommandRegistry
@ -197,7 +200,7 @@ namespace control {
Command cloneDefinition;
cloneDefinition.activate (move (registry.createCloneImpl(this->impl())), newCmdID);
ENSURE (cloneDefinition);
return cloneDefinition;
return cloneDefinition;
}
@ -212,7 +215,7 @@ namespace control {
Command clone;
clone.activate (move (cloneImpl));
ENSURE (clone);
return clone;
return clone;
}
@ -226,7 +229,7 @@ namespace control {
{
CommandImplCloneBuilder cloneBuilder(allocator_);
refObject.prepareClone(cloneBuilder);
return allocator_.create<CommandImpl> (refObject, cloneBuilder.clonedUndoMutation()
return allocator_.create<CommandImpl> (refObject, cloneBuilder.clonedUndoMutation()
, cloneBuilder.clonedClosuere());
}
@ -246,7 +249,7 @@ namespace control {
bool
Command::remove (Symbol cmdID)
{
return CommandRegistry::instance().remove (cmdID);
return CommandRegistry::instance().remove (cmdID);
}

View file

@ -81,7 +81,14 @@
#include <string>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS); ///< Command functor not yet usable, because arguments aren't bound
LUMIERA_ERROR_DECLARE (INVALID_COMMAND); ///< Unknown or insufficiently defined command
LUMIERA_ERROR_DECLARE (DUPLICATE_COMMAND); ///< Attempt to redefine an already existing command definition
LUMIERA_ERROR_DECLARE (INVALID_ARGUMENTS); ///< Arguments provided for binding doesn't match stored command function parameters
LUMIERA_ERROR_DECLARE (MISSING_MEMENTO); ///< Undo functor not yet usable, because no undo state has been captured
}}
namespace steam {
namespace control {
@ -92,15 +99,7 @@ namespace control {
using lib::meta::Tuple;
using lib::meta::Types;
LUMIERA_ERROR_DECLARE (UNBOUND_ARGUMENTS); ///< Command functor not yet usable, because arguments aren't bound
LUMIERA_ERROR_DECLARE (INVALID_COMMAND); ///< Unknown or insufficiently defined command
LUMIERA_ERROR_DECLARE (DUPLICATE_COMMAND); ///< Attempt to redefine an already existing command definition
LUMIERA_ERROR_DECLARE (INVALID_ARGUMENTS); ///< Arguments provided for binding doesn't match stored command function parameters
typedef void* FuncPtr;
using FuncPtr = void*;
class CommandDef;
class CommandImpl;

View file

@ -54,14 +54,13 @@
namespace steam {
namespace control {
namespace err = lumiera::error;
using boost::equality_comparable;
using lib::meta::func::bindLast;
using lib::meta::func::chained;
using lib::meta::equals_safeInvoke;
using lib::wrapper::ReplaceableItem;
LUMIERA_ERROR_DECLARE (MISSING_MEMENTO); ///< Undo functor not yet usable, because no undo state has been captured
/**
@ -174,8 +173,8 @@ namespace control {
getState ()
{
if (!isCaptured_)
throw lumiera::error::State ("need to invoke memento state capturing beforehand",
LERR_(MISSING_MEMENTO));
throw err::State{"need to invoke memento state capturing beforehand"
, LERR_(MISSING_MEMENTO)};
return memento_;
}

View file

@ -189,7 +189,7 @@ namespace control {
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
lib::Depend<SessionCommandService> _instance; ///< a backdoor for the C Language impl to access the actual SessionCommand implementation...

View file

@ -126,9 +126,6 @@ namespace engine {
namespace metadata {
using error::LERR_(LIFECYCLE);
using error::LERR_(BOTTOM_VALUE);
namespace { // details of hash calculation
template<typename VAL>
HashVal
@ -649,19 +646,19 @@ namespace engine {
,bool onlyNew =false)
{
if (!concreteBuffer)
throw error::Invalid ("Attempt to lock a slot for a NULL buffer"
, error::LUMIERA_ERROR_BOTTOM_VALUE);
throw error::Invalid{"Attempt to lock a slot for a NULL buffer"
, LERR_(BOTTOM_VALUE)};
Entry newEntry(parentKey, concreteBuffer, implID);
Entry* existing = table_.fetch (newEntry);
if (existing && onlyNew)
throw error::Logic ("Attempt to lock a slot for a new buffer, "
"while actually the old buffer is still locked"
, error::LUMIERA_ERROR_LIFECYCLE );
throw error::Logic{"Attempt to lock a slot for a new buffer, "
"while actually the old buffer is still locked"
, LERR_(LIFECYCLE)};
if (existing && existing->isLocked())
throw error::Logic ("Attempt to re-lock a buffer still in use"
, error::LUMIERA_ERROR_LIFECYCLE );
throw error::Logic{"Attempt to re-lock a buffer still in use"
, LERR_(LIFECYCLE)};
if (!existing)
return store_and_lock (newEntry); // actual creation
@ -719,8 +716,8 @@ namespace engine {
markLocked (Key const& parentKey, void* buffer, LocalKey const& implID =UNSPECIFIC)
{
if (!buffer)
throw error::Fatal ("Attempt to lock for a NULL buffer. Allocation floundered?"
, error::LUMIERA_ERROR_BOTTOM_VALUE);
throw error::Fatal{"Attempt to lock for a NULL buffer. Allocation floundered?"
, LERR_(BOTTOM_VALUE)};
return this->lock(parentKey, buffer, implID, true); // force creation of a new entry
}
@ -742,8 +739,8 @@ namespace engine {
release (Entry const& entry)
{
if (FREE != entry.state())
throw error::Logic ("Attempt to release a buffer still in use"
, error::LUMIERA_ERROR_LIFECYCLE);
throw error::Logic{"Attempt to release a buffer still in use"
, LERR_(LIFECYCLE)};
table_.remove (HashVal(entry));
}

View file

@ -210,8 +210,8 @@ namespace engine {
REQUIRE (refEntry.isTypeKey());
REQUIRE (!metaEntry.isTypeKey());
if (!metaEntry.isLocked())
throw error::Logic ("unable to attach an object because buffer isn't locked for use"
, LERR_(LIFECYCLE));
throw error::Logic{"unable to attach an object because buffer isn't locked for use"
, LERR_(LIFECYCLE)};
metaEntry.useTypeHandlerFrom (refEntry); // EX_STRONG
}

View file

@ -64,9 +64,7 @@
namespace steam {
namespace engine {
namespace error = lumiera::error;
using error::LERR_(LIFECYCLE);
using lib::HashVal;

View file

@ -43,9 +43,7 @@
namespace steam {
namespace engine {
namespace error = lumiera::error;
using error::LERR_(LIFECYCLE);
using lib::HashVal;

View file

@ -21,12 +21,12 @@
* *****************************************************/
/** @file mobject-ref.cpp
** Implementation part of the MObjectRef facility.
/** @file mobject-ref.cpp
** Implementation part of the MObjectRef facility.
** Any C++ client about to use a MObjectRef needs to be linked (dynamically) against
** this implementation. Especially, this implementation allows to (re)-connect transparently
** to the PlacementIndex within the session, so to establish a direct link to the Object
** denoted by the reference.
** denoted by the reference.
**
** @see PlacementRef
** @see PlacementIndex
@ -38,6 +38,13 @@
#include "steam/mobject/mobject.hpp"
#include "steam/mobject/placement.hpp"
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE (INVALID_PLACEMENTREF, "unresolvable placement reference, or of incompatible type");
LUMIERA_ERROR_DEFINE (BOTTOM_PLACEMENTREF, "NIL placement-ID marker encountered.");
LUMIERA_ERROR_DEFINE (BOTTOM_MOBJECTREF, "NIL MObjectRef encountered");
}}
namespace steam {
namespace mobject {
@ -45,12 +52,4 @@ namespace mobject {
/** */
LUMIERA_ERROR_DEFINE (INVALID_PLACEMENTREF, "unresolvable placement reference, or of incompatible type");
LUMIERA_ERROR_DEFINE (BOTTOM_PLACEMENTREF, "NIL placement-ID marker encountered.");
LUMIERA_ERROR_DEFINE (BOTTOM_MOBJECTREF, "NIL MObjectRef encountered");
}} // namespace steam::mobject

View file

@ -69,18 +69,19 @@
///////////////////////////////////////////TODO: define an C-API representation here, make the header multilingual!
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (BOTTOM_MOBJECTREF); ///< NIL MObjectRef encountered
}}
namespace steam {
namespace mobject {
namespace error = lumiera::error;
class MObject;
LUMIERA_ERROR_DECLARE (BOTTOM_MOBJECTREF); ///< NIL MObjectRef encountered
/**
* An active (smart-ptr like) external reference
* to a specifically placed MObject "instance" within the session.
@ -137,7 +138,7 @@ namespace mobject {
/** allow to use MObjectRef instead of a Placement-ID (hash)
* @todo not sure if that leads to unexpected conversions,
* because the underlying implementation can be
* because the underlying implementation can be
* converted to size_t */ //////////////////////////TICKET #682 revisit that decision later
operator _Id const&() const
{
@ -146,7 +147,7 @@ namespace mobject {
/** resolves the referred placement to an
/** resolves the referred placement to an
* ExplicitPlacement and returns the found start time
*/
lib::time::Time
@ -157,7 +158,7 @@ namespace mobject {
/** attach a child element to the model
* @param newPlacement to be copied into the model, placed
* @param newPlacement to be copied into the model, placed
* into the scope of the object denoted by this MORef
* @return MORef designing the newly created and attached object instance
*/
@ -181,7 +182,7 @@ namespace mobject {
*/
void
purge ()
{
{
if (isValid())
session::SessionServiceMutate::detach_and_clear (pRef_);
@ -214,7 +215,7 @@ namespace mobject {
* - any Placement-ID
* - any Placement-Ref
* - a plain LUID
* @throws error::Invalid when the (directly or indirectly
* @throws error::Invalid when the (directly or indirectly
* referred placement isn't known to the session PlacementIndex,
* or when the placement actually found has an incompatible dynamic type
*/
@ -233,7 +234,7 @@ namespace mobject {
/** build and activate an MObject reference based on
* an existing reference of the same pointee type
* @note STRONG exception safety guarantee
* @throws error::Invalid when the referred placement
* @throws error::Invalid when the referred placement
* isn't known to the current session's PlacementIndex
*/
MORef&
@ -254,7 +255,7 @@ namespace mobject {
* @note STRONG exception safety guarantee
* @throws error::Invalid when the referred placement isn't registered
* within the current session, or if the runtime type of the pointees
* aren't assignment compatible
* aren't assignment compatible
*/
template<typename MOX>
MORef&
@ -270,7 +271,7 @@ namespace mobject {
bool
isValid() const
{
return _Handle::isValid()
return _Handle::isValid()
&& pRef_.isValid();
}

View file

@ -217,8 +217,8 @@ namespace mobject {
operator Target()
{
if (not isValid())
throw error::Logic ("attempt to resolve an unconnected output mapping"
, error::LERR_(UNCONNECTED));
throw error::Logic{"attempt to resolve an unconnected output mapping"
, LERR_(UNCONNECTED)};
return resolve();
}

View file

@ -71,22 +71,22 @@
#include "steam/mobject/session/session-service-fetch.hpp"
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (INVALID_PLACEMENTREF); ///< unresolvable placement reference, or of incompatible type
LUMIERA_ERROR_DECLARE (BOTTOM_PLACEMENTREF); ///< NIL placement-ID marker encountered
}}
namespace steam {
namespace error = lumiera::error;
namespace mobject {
class MObject;
LUMIERA_ERROR_DECLARE (INVALID_PLACEMENTREF); ///< unresolvable placement reference, or of incompatible type
LUMIERA_ERROR_DECLARE (BOTTOM_PLACEMENTREF); ///< NIL placement-ID marker encountered
/**
* Reference tag denoting a placement attached to the session.
* Implemented as a smart-handle, transparently accessing the
@ -110,7 +110,7 @@ namespace steam {
* Any source allowing to infer a \em compatible mobject::Placement
* is accepted. Here, compatibility is decided based on the run time
* type of the pointee, in comparison to the template parameter Y.
* In any case, for this ctor to succeed, the provided ref or ID
* In any case, for this ctor to succeed, the provided ref or ID
* needs to be resolvable to a placement by the implicit PlacementIndex
* facility used by all PlacementRef instances (typically the Session).
* @note there is no default ctor, a reference source is mandatory.
@ -118,14 +118,14 @@ namespace steam {
* - an existing Placement
* - just an Placement::ID
* - a plain LUID
* @throw error::Invalid on incompatible run time type of the resolved ID
* @throw error::Invalid on incompatible run time type of the resolved ID
*/
template<class Y>
explicit
PlacementRef (Y const& refID)
: id_(recast (refID))
{
validate(id_);
{
validate(id_);
}
/** Default is an NIL Placement ref. It throws on any access. */
@ -137,15 +137,15 @@ namespace steam {
PlacementRef (PlacementRef const& r) ///< copy ctor
: id_(r.id_)
{
validate(id_);
{
validate(id_);
}
template<class X>
PlacementRef (PlacementRef<X> const& r) ///< extended copy ctor, when type X is assignable to MX
: id_(recast(r))
{
validate(id_);
validate(id_);
}
@ -183,7 +183,7 @@ namespace steam {
PlacementMX& operator*() const { return access(id_); } ///< dereferencing fetches referred Placement from Index
PlacementMX& operator->() const { return access(id_); } ///< provide access to pointee API by smart-ptr chaining
PlacementMX& operator->() const { return access(id_); } ///< provide access to pointee API by smart-ptr chaining
operator string() const { return access(id_).operator string(); }
size_t use_count() const { return access(id_).use_count(); }
@ -211,7 +211,7 @@ namespace steam {
}
bool isValid() const
{
{
if (checkValidity())
try
{
@ -270,15 +270,15 @@ namespace steam {
access (_Id const& placementID)
{
if (!placementID)
throw error::Logic ("Attempt to access a NIL PlacementRef"
, LERR_(BOTTOM_PLACEMENTREF));
throw error::Logic{"Attempt to access a NIL PlacementRef"
, LERR_(BOTTOM_PLACEMENTREF)};
Placement<MObject> & genericPlacement (session::SessionServiceFetch::resolveID (placementID)); // may throw
REQUIRE (genericPlacement.isValid());
if (!(genericPlacement.template isCompatible<MX>()))
throw error::Invalid("actual type of the resolved placement is incompatible"
, LERR_(INVALID_PLACEMENTREF));
throw error::Invalid{"actual type of the resolved placement is incompatible"
, LERR_(INVALID_PLACEMENTREF)};
////////////////////////TODO: 1. better message, including type?
////////////////////////TODO: 2. define a separate error-ID for the type mismatch!

View file

@ -104,9 +104,9 @@ namespace mobject {
*
* Placements are defined to form a hierarchy, thereby mirroring
* the relations between their referents to some degree. This allows
* for building APIs targeted at specific kinds of MObjects, and
* for building APIs targeted at specific kinds of MObjects, and
* at the same time allows a specific placement to stand-in when
* just a unspecific Placement<MObject> is required.
* just a unspecific Placement<MObject> is required.
*
* @param MO the (compile time) type of the referent
* @param B immediate base class of this placement
@ -115,7 +115,7 @@ namespace mobject {
class Placement ;
/**
/**
* this specialisation forms the root of all placements
* and defines all of Placement's actual functionality.
*/
@ -134,15 +134,15 @@ namespace mobject {
public:
/** smart pointer: accessing the MObject,
/** smart pointer: accessing the MObject,
* which is subject to placement.
* @note we don't provide operator*
*/
MObject *
operator-> () const
{
ENSURE (*this);
return _SmartPtr::operator-> ();
MObject *
operator->() const
{
ENSURE (*this);
return _SmartPtr::operator->();
}
/** run time diagnostics: is the pointee
@ -186,7 +186,7 @@ namespace mobject {
/** interface for defining the kind of placement
* to employ, and for controlling any additional
* constraints and properties.
* constraints and properties.
*/
session::LocatingPin chain;
@ -194,7 +194,7 @@ namespace mobject {
* by the various LocatingPin (\see #chain) and
* provide the resulting (explicit) placement.
*/
virtual ExplicitPlacement resolve () const;
virtual ExplicitPlacement resolve () const;
//////////////////////////TODO (1) could resolve() return a reference? Otherwise placement-ref.hpp needs to include ExplicitPlacement
//////////////////////////TODO (2) does this really need to be virtual. Guess not. It's not abstract and not really polymorphic. But virtual here causes template bloat.
////////////TICKET #439
@ -207,7 +207,7 @@ namespace mobject {
{ }
protected:
Placement (MObject & subject, Deleter killer)
Placement (MObject & subject, Deleter killer)
: _SmartPtr (&subject, killer) { };
friend class session::MObjectFactory;
@ -258,7 +258,7 @@ namespace mobject {
_Id
getID () const ///< @note overrides HashIndexed::getID to pass specific type information,
{
{
return _Parent::template recastID<MO>();
}
@ -266,9 +266,8 @@ namespace mobject {
/** @todo cleanup uses of ref-to-placement. See Ticket #115 */
typedef Placement<MObject> PlacementMO;
//typedef class mobject::Placement<mobject::MObject, mobject::MObject> mobject::PlacementMO
typedef Placement<MObject> PMO;
typedef Placement<MObject> PlacementMO;
typedef Placement<MObject> PMO;

View file

@ -21,7 +21,7 @@
* *****************************************************/
/** @file placement-index.cpp
/** @file placement-index.cpp
** Implementation of core session storage structure.
** The PlacementIndex associates IDs to instances, within a nested scope structure.
** Moreover, it provides and manages the actual Placement instances (storage),
@ -33,7 +33,7 @@
** associations, especially for enumerating the contents of a scope. The latter is done
** by wrapping up an STL iterator range into a "Lumiera Forward Iterator" (adapter).
** Generally speaking, PlacementIndex is an implementation level facility and provides
** the basic/low-level functionality. For example, the PlacementIndexQueryResolver
** the basic/low-level functionality. For example, the PlacementIndexQueryResolver
** provides depth-first exploration of all the contents of an scope, including
** nested scopes, building on top of the scope iterators from PlacementIndex.
**
@ -65,6 +65,12 @@
#include <memory>
#include <string>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE (NOT_IN_SESSION, "referring to a Placement not known to the current session");
LUMIERA_ERROR_DEFINE (PLACEMENT_TYPE, "requested Placement (pointee) type not compatible with data or context");
LUMIERA_ERROR_DEFINE (NONEMPTY_SCOPE, "Placement scope (still) contains other elements");
}}
namespace steam {
namespace mobject {
@ -89,14 +95,11 @@ namespace session {
using util::for_each;
using util::has_any;
LUMIERA_ERROR_DEFINE (NOT_IN_SESSION, "referring to a Placement not known to the current session");
LUMIERA_ERROR_DEFINE (PLACEMENT_TYPE, "requested Placement (pointee) type not compatible with data or context");
LUMIERA_ERROR_DEFINE (NONEMPTY_SCOPE, "Placement scope (still) contains other elements");
/* some type shorthands */
typedef mobject::PlacementMO PlacementMO;
typedef mobject::PlacementMO PlacementMO;
typedef PlacementIndex::PRef PRef;
typedef PlacementIndex::ID ID;
@ -104,11 +107,11 @@ namespace session {
/*****************************************************************//**
* Storage and implementation backing the PlacementIndex
* - #placementTab_ is an hashtable mapping IDs to Placement + Scope
* - #scopeTab_ is an reverse association serving to keep track of
* - #scopeTab_ is an reverse association serving to keep track of
* any scope's contents
* - root scope element is stored and maintained explicitly.
*/
class PlacementIndex::Table
class PlacementIndex::Table
{
typedef shared_ptr<PlacementMO> PPlacement;
@ -133,21 +136,19 @@ namespace session {
PPlacement root_;
public:
Table ()
Table()
{ }
~Table ()
{
try
{
root_.reset();
clear();
}
catch(lumiera::Error& err)
{
WARN (session, "Problem while purging PlacementIndex: %s", err.what());
lumiera_error(); // discard any error state
} }
~Table()
try {
root_.reset();
clear();
}
catch (lumiera::Error& err)
{
WARN (session, "Problem while purging PlacementIndex: %s", err.what());
lumiera_error(); // discard any error state
}
size_t
@ -155,13 +156,13 @@ namespace session {
{
return placementTab_.size();
}
size_t
scope_cnt() const ///<@note root doesn't produce an scope entry
{
return scopeTab_.size();
}
size_t
element_cnt() const
{
@ -221,7 +222,7 @@ namespace session {
/** insert a specially configured root entry into
* the yet empty table. Root is it's own scope
* the yet empty table. Root is it's own scope
*/
void
setupRoot (PlacementMO const& rootDef)
@ -257,7 +258,7 @@ namespace session {
* It can be rediscovered later with the help
* of the pointee's vtable
* @see Placement#isCompatible
*/
*/
ID
addEntry (PlacementMO const& newObj, ID scopeID)
{
@ -284,10 +285,10 @@ namespace session {
}
if (util::contains(scopeTab_, id))
throw error::State ("Unable to remove the specified Placement, "
"because it defines an non-empty scope. "
"You need to delete any contents first."
,LUMIERA_ERROR_NONEMPTY_SCOPE); ////////////////TICKET #197
throw error::State{"Unable to remove the specified Placement, "
"because it defines an non-empty scope. "
"You need to delete any contents first."
, LERR_(NONEMPTY_SCOPE)}; //////////////////////////////TICKET #197
ASSERT (contains (id));
PlacementEntry toRemove = remove_base_entry (id);
@ -407,13 +408,12 @@ namespace session {
mutable ElementResolver elementResolver_;
ElementResolver
scopeIndexElementsResolver() const ///< @return functor for iterator element access
scopeIndexElementsResolver() const ///< @return functor for iterator element access
{
if (!elementResolver_)
elementResolver_ = bind (&Table::resolveScopeIndexElement, this, _1 );
return elementResolver_;
}
};
//(End) placement index table implementation
@ -472,7 +472,7 @@ namespace session {
/** retrieve the Scope information
* registered alongside with the denoted Placement.
* @throw error::Invalid when the given ID isn't registered
* @note root is it's own scope, per definition.
* @note root is it's own scope, per definition.
*/
PlacementMO&
PlacementIndex::getScope (ID id) const
@ -502,7 +502,7 @@ namespace session {
* The given Placement is copied into the storage managed within the session.
* This copy within the storage is what will be "the placement of this object".
* It can be discovered as index (Session) content, re-accessed by the ID returned
* from this call and modified in the course of editing the session.
* from this call and modified in the course of editing the session.
* @param newObj reference placement pointing to the MObject to be added
* @param targetScope ref to a placement already added to the index, serving as
* container "into" which the new placement will be located
@ -580,11 +580,11 @@ namespace session {
}
/**
/**
* PlacementIndex self-verification code
* Executes all built-in checks automatically
* on object creation.
* @throw SelfCheckFailure
* @throw SelfCheckFailure
*/
class PlacementIndex::Validator
{
@ -691,7 +691,7 @@ namespace session {
/** validity self-check, used for sanity checks and the session self-check.
* The following checks are performed (causing at least one full table scan)

View file

@ -56,7 +56,7 @@
** When adding a Placement to the index, it is mandatory to specify a Scope: this is
** another Placement already registered within the index; the new Placement can be thought
** of as being located "within" or "below" this scope-defining reference Placement. An
** typical example would be the addition of a \c Placement<session::Clip>, specifying
** typical example would be the addition of a \c Placement<session::Clip>, specifying
** a \c Placement<session::Fork> as scope. This would bring the mentioned Clip onto the
** "Track", as implemented by a Fork-MObject. Thus, all "object instances" within the
** session are arranged in a tree-like fashion. On creation of the PlacementIndex,
@ -133,6 +133,13 @@ namespace std {
}
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (NOT_IN_SESSION); ///< referring to a Placement not known to the current session
LUMIERA_ERROR_DECLARE (PLACEMENT_TYPE); ///< requested Placement (pointee) type not compatible with data or context
LUMIERA_ERROR_DECLARE (NONEMPTY_SCOPE); ///< Placement scope (still) contains other elements
}}
namespace steam {
namespace mobject {
@ -140,11 +147,6 @@ namespace mobject {
namespace session {
LUMIERA_ERROR_DECLARE (NOT_IN_SESSION); ///< referring to a Placement not known to the current session
LUMIERA_ERROR_DECLARE (PLACEMENT_TYPE); ///< requested Placement (pointee) type not compatible with data or context
LUMIERA_ERROR_DECLARE (NONEMPTY_SCOPE); ///< Placement scope (still) contains other elements
using std::unique_ptr;
@ -210,17 +212,17 @@ namespace session {
PlacementMO& getScope (PlacementMO const&) const;
PlacementMO& getScope (ID) const;
iterator getReferrers (ID) const;
/** retrieve the logical root scope */
/** retrieve the logical root scope */
PlacementMO& getRoot() const;
size_t size() const;
bool contains (PlacementMO const&) const;
bool contains (ID) const;
bool isValid() const;
@ -294,7 +296,7 @@ namespace session {
return static_cast<Placement<MO>&> (result);
}
template<class MO>
inline Placement<MO>&
PlacementIndex::find (PlacementRef<MO> const& pRef) const
@ -307,7 +309,7 @@ namespace session {
inline Placement<MObject>&
PlacementIndex::getScope (PlacementMO const& p) const
{
return getScope(p.getID());
return getScope(p.getID());
}

View file

@ -93,8 +93,8 @@ namespace session {
___check_validTaget (Scope const& target)
{
if (!target.isValid())
throw Invalid ("Invalid target location for QueryFocus"
, LUMIERA_ERROR_INVALID_SCOPE); ////////////////TICKET #197
throw Invalid{"Invalid target location for QueryFocus"
, LERR_(INVALID_SCOPE)}; /////////////////////////////////////////TICKET #197
}
}//(End) shortcut

View file

@ -49,11 +49,6 @@ namespace session {
using util::isnil;
LUMIERA_ERROR_DEFINE (EMPTY_SCOPE_PATH, "Placement scope not locatable (empty model path)");
namespace { // Helpers and shortcuts....
/** issue a query to discover the (raw) path to root,

View file

@ -122,9 +122,6 @@ namespace mobject {
namespace session {
LUMIERA_ERROR_DECLARE (EMPTY_SCOPE_PATH); ///< Placement scope not locatable (empty model path)
/**
* Sequence of nested scopes within the high-level model.
* Implemented as vector of Scope elements. Providing

View file

@ -53,15 +53,19 @@ using std::vector;
using lib::IterSource;
using lib::iter_source::wrapIter;
namespace lumiera {
namespace error {
LUMIERA_ERROR_DEFINE (INVALID_SCOPE, "Placement scope invalid and not locatable within model");
LUMIERA_ERROR_DEFINE (NO_PARENT_SCOPE, "Parent scope of root not accessible");
LUMIERA_ERROR_DEFINE (EMPTY_SCOPE_PATH, "Placement scope not locatable (empty model path)");
}}
namespace steam {
namespace mobject {
namespace session {
LUMIERA_ERROR_DEFINE (INVALID_SCOPE, "Placement scope invalid and not locatable within model");
LUMIERA_ERROR_DEFINE (NO_PARENT_SCOPE, "Parent scope of root not accessible");
/** conversion of a scope top (placement) into a Scope.
* only allowed if the given Placement is actually attached

View file

@ -37,13 +37,17 @@
#include <string>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (EMPTY_SCOPE_PATH); ///< Placement scope not locatable (empty model path)
LUMIERA_ERROR_DECLARE (NO_PARENT_SCOPE); ///< Parent scope of root not accessible
LUMIERA_ERROR_DECLARE (INVALID_SCOPE); ///< Placement scope invalid and not locatable within model
}}
namespace steam {
namespace mobject {
namespace session {
LUMIERA_ERROR_DECLARE (NO_PARENT_SCOPE); ///< Parent scope of root not accessible
LUMIERA_ERROR_DECLARE (INVALID_SCOPE); ///< Placement scope invalid and not locatable within model
/**

View file

@ -176,7 +176,7 @@ namespace steam {
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
lib::Depend<DummyPlayerService> _instance; ///< a backdoor for the C Language impl to access the actual SessionCommand implementation...
typedef ProcessImpl* ProcP;

View file

@ -41,6 +41,11 @@
#include <memory>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (CANT_PLAY); ///< unable to build playback or render process for this configuration
}}
namespace steam {
namespace play {
@ -49,13 +54,6 @@ namespace play {
using std::shared_ptr;
LUMIERA_ERROR_DECLARE(CANT_PLAY); ///< unable to build playback or render process for this configuration
/**************************************************//**

View file

@ -57,8 +57,8 @@ namespace play {
: outputFeeds_(feeds)
{
if (isnil (feeds))
throw error::State ("creating a PlayProcess without any usable output connections"
, LUMIERA_ERROR_CANT_PLAY);
throw error::State{"creating a PlayProcess without any usable output connections"
, LERR_(CANT_PLAY)};
}

View file

@ -53,6 +53,10 @@ namespace lumiera {
/** static storage for the facade access front-end */
lib::Depend<Play> Play::facade;
namespace error {
LUMIERA_ERROR_DEFINE (CANT_PLAY, "unable to build playback or render process for this configuration");
}
}//(End) namespace lumiera
@ -197,9 +201,6 @@ namespace play {
LUMIERA_ERROR_DEFINE (CANT_PLAY, "unable to build playback or render process for this configuration");
}} // namespace steam::play

View file

@ -65,6 +65,11 @@
//#include <string>
namespace lumiera {
namespace error {
LUMIERA_ERROR_DECLARE (CANT_PLAY); ///< unable to build playback or render process for this configuration
}}
namespace steam {
namespace play {
@ -116,10 +121,5 @@ namespace play {
};
LUMIERA_ERROR_DECLARE (CANT_PLAY); ///< unable to build playback or render process for this configuration
}} // namespace steam::play
#endif

View file

@ -77,8 +77,8 @@ namespace play {
REQUIRE (outputResolver_);
OutputSlot& slot = outputResolver_->getOutputFor (port);
if (!slot.isFree())
throw error::State("unable to acquire a suitable output slot" /////////////////////TICKET #197 #816 --- could use util::_Fmt here
, LERR_(CANT_PLAY));
throw error::State{"unable to acquire a suitable output slot" /////////////////////TICKET #197 #816 --- could use util::_Fmt here
, LERR_(CANT_PLAY)};
return slot;
}

View file

@ -72,8 +72,8 @@ namespace test{
};
}
using error::LERR_(LIFECYCLE);
using error::LERR_(FATAL);
using LERR_(LIFECYCLE);
using LERR_(FATAL);

View file

@ -58,7 +58,7 @@ namespace test{
} // (End) test setup....
using lib::ThreadJoinable;
using error::LERR_(LOGIC);
using LERR_(LOGIC);
using std::rand;

View file

@ -47,7 +47,8 @@ using std::string;
namespace lib {
namespace test{
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
/**
* Target object to be instantiated as Singleton

View file

@ -34,7 +34,7 @@
#include <cstdlib>
using lumiera::error::LERR_(ASSERTION);
using LERR_(ASSERTION);
using util::isSameObject;
using util::typeStr;
using std::rand;

View file

@ -57,7 +57,7 @@ namespace test{
using steam::asset::meta::TimeGrid;
using lib::meta::Types;
using lib::meta::InstantiateChainedCombinations;
using error::LERR_(UNCONNECTED);
using LERR_(UNCONNECTED);

View file

@ -41,7 +41,7 @@ namespace time{
namespace test{
using steam::asset::meta::TimeGrid;
using format::LERR_(INVALID_TIMECODE);
using LERR_(INVALID_TIMECODE);
namespace { // Helper for writing test cases

View file

@ -38,7 +38,7 @@ using boost::lexical_cast;
using util::isnil;
using std::string;
using lumiera::error::LERR_(BOTTOM_VALUE);
using LERR_(BOTTOM_VALUE);
namespace lib {
namespace time{

View file

@ -87,8 +87,8 @@ namespace test {
/** marker for simulated failure exceptions */
LUMIERA_ERROR_DEFINE( TEST, "simulated failure.");
using error::LERR_(LOGIC);
using error::LERR_(STATE);
using LERR_(LOGIC);
using LERR_(STATE);
@ -147,7 +147,7 @@ namespace test {
return true;
else
if ("throw"==startSpec) //---starting flounders
throw error::Fatal("simulated failure to start the subsystem", LERR_(TEST));
throw error::Fatal("simulated failure to start the subsystem", LUMIERA_ERROR_TEST);
return started_;
}
@ -212,7 +212,7 @@ namespace test {
if ("true" ==runSpec) termination(0); // signal regular termination
if ("throw"==runSpec)
{
Error problemIndicator("simulated Problem terminating subsystem",LERR_(TEST));
Error problemIndicator("simulated Problem terminating subsystem",LUMIERA_ERROR_TEST);
lumiera_error(); // reset error state....
// Note: in real life this actually
// would be an catched exception!

View file

@ -51,6 +51,9 @@ namespace steam {
namespace asset{
namespace test {
using LERR_(UNKNOWN_ASSET_ID);
using LERR_(WRONG_ASSET_KIND);
using MediaAccessMock = lib::DependInject<vault::MediaAccessFacade>
::Local<vault::test::MediaAccessMock>;
@ -66,7 +69,7 @@ namespace test {
virtual void run(Arg arg)
{
MediaAccessMock useMockMedia;
createMedia();
factoryVariants();
createMetaAssets();
@ -128,19 +131,12 @@ namespace test {
CHECK (aMang.known (mm3->getID()));
CHECK ( !aMang.known (mm3->getID(), Category(AUDIO))); // not found within AUDIO-Category
try
{ // can't be found if specifying wrong Asset kind....
aMang.getAsset (ID<asset::Proc>(mm1->getID()));
NOTREACHED();
}
catch (lumiera::error::Invalid& xxx) {CHECK (xxx.getID()==LUMIERA_ERROR_WRONG_ASSET_KIND);}
try
{ // try accessing nonexistent ID
aMang.getAsset (ID<Asset> (1234567890));
NOTREACHED();
}
catch (lumiera::error::Invalid& xxx) {CHECK (xxx.getID()==LUMIERA_ERROR_UNKNOWN_ASSET_ID);}
lumiera_error (); // reset errorflag
// can't be found if specifying wrong Asset kind....
VERIFY_ERROR (WRONG_ASSET_KIND, aMang.getAsset (ID<asset::Proc>(mm1->getID())) );
// try accessing nonexistent ID
VERIFY_ERROR (UNKNOWN_ASSET_ID, aMang.getAsset (ID<Asset> (1234567890)) );
// checking the Ident-Fields

View file

@ -54,7 +54,7 @@ namespace lib {
namespace idi {
namespace test{
using lumiera::error::LERR_(WRONG_TYPE);
using LERR_(WRONG_TYPE);
namespace { // Test definitions...

View file

@ -59,8 +59,7 @@ namespace test {
using lib::test::showSizeof;
using lib::test::randTime;
using namespace lib::meta;
using LERR_(MISSING_MEMENTO);

View file

@ -50,9 +50,10 @@ namespace test {
using std::move;
using std::rand;
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
using LERR_(INVALID_COMMAND);
using LERR_(DUPLICATE_COMMAND);
using LERR_(UNBOUND_ARGUMENTS);
namespace { // Test fixture....

View file

@ -49,6 +49,8 @@ namespace test {
using namespace lib::meta;
using control::CmdClosure;
using LERR_(MISSING_MEMENTO);
using LERR_(UNBOUND_ARGUMENTS);
namespace { /* ======= test functions to bind ========= */

View file

@ -24,25 +24,19 @@
#include "lib/test/run.hpp"
#include "steam/control/command-queue.hpp"
#include "steam/control/command-def.hpp"
//#include "steam/control/command-registry.hpp"
//#include "lib/test/event-log.hpp"
#include "lib/symbol.hpp"
#include "lib/util.hpp"
#include "steam/control/test-dummy-commands.hpp"
//#include <cstdlib>
namespace steam {
namespace control {
namespace test {
namespace steam {
namespace control{
namespace test {
// using std::function;
// using std::rand;
using lib::Symbol;
using util::isnil;
using LERR_(UNBOUND_ARGUMENTS);
namespace { // test fixture...
@ -52,11 +46,6 @@ namespace test {
}//(End) test fixture
// typedef shared_ptr<CommandImpl> PCommandImpl;
// typedef HandlingPattern const& HaPatt;
@ -64,7 +53,6 @@ namespace test {
* @test verify proper working of queue management used within SteamDispatcher.
* - can enqueue and dequeue command messages
* - handling of priority messages
*
* @see CommandQueue
* @see DispatcherLoop
* @see SteamDispatcher
@ -95,7 +83,7 @@ namespace test {
}
//-------------(End)FIXTURE
virtual void
run (Arg)
{

View file

@ -41,9 +41,10 @@ namespace test {
using util::isSameObject;
using util::contains;
using LERR_(INVALID_COMMAND);
using LERR_(DUPLICATE_COMMAND);
using LERR_(UNBOUND_ARGUMENTS);
using LERR_(INVALID_ARGUMENTS);
@ -52,7 +53,6 @@ namespace test {
* @test command usage aspects I: defining commands in various ways,
* then re-accessing those definitions, create instances,
* invoke them and undo the effect. Clean up finally.
*
* @see Command
* @see command-basic-test.cpp (simple usage example)
*/
@ -65,7 +65,7 @@ namespace test {
virtual void
run (Arg)
run (Arg)
{
command1::check_ = 0;
uint cnt_defs = Command::definition_count();

View file

@ -52,7 +52,6 @@ namespace steam {
namespace control {
namespace test {
using util::_Fmt;
using std::string;
using std::function;
@ -61,8 +60,7 @@ namespace test {
using boost::lexical_cast;
using util::contains;
using lumiera::error::LERR_(EXTERNAL);
using LERR_(EXTERNAL);
/** diagnostics: checks if the given value has been written

View file

@ -37,13 +37,10 @@ using std::bind;
using std::rand;
namespace steam {
namespace steam {
namespace control {
namespace test {
namespace {
int testVal=0; ///< used to verify the effect of testFunc
@ -67,6 +64,8 @@ namespace test {
const size_t ALIGNMENT = sizeof(size_t);
}
using LERR_(MISSING_MEMENTO);
/*************************************************************************************//**

View file

@ -43,11 +43,6 @@ namespace engine{
namespace metadata{
namespace test {
using lumiera::error::LERR_(INVALID);
using lumiera::error::LERR_(LIFECYCLE);
namespace { // Test fixture
const size_t TEST_MAX_SIZE = 1024 * 1024;

View file

@ -47,9 +47,9 @@ namespace steam {
namespace engine{
namespace test {
using lumiera::error::LERR_(FATAL);
using lumiera::error::LERR_(INVALID);
using lumiera::error::LERR_(LIFECYCLE);
using LERR_(FATAL);
using LERR_(INVALID);
using LERR_(LIFECYCLE);
namespace { // Test fixture

View file

@ -46,8 +46,8 @@ namespace test {
using lib::test::Dummy;
using steam::engine::BuffHandle;
using error::LERR_(LOGIC);
using error::LERR_(LIFECYCLE);
using LERR_(LIFECYCLE);
using LERR_(LOGIC);
namespace { // Test fixture

View file

@ -43,6 +43,7 @@
#include "lib/format-cout.hpp"
#include "lib/util.hpp"
#include <string>
using lib::test::showSizeof;
using lib::time::Duration;
@ -52,7 +53,7 @@ using util::isnil;
using std::string;
namespace steam {
namespace steam {
namespace mobject {
namespace test {
@ -77,6 +78,9 @@ namespace test {
}
using LERR_(INVALID_PLACEMENTREF);
using LERR_(BOTTOM_MOBJECTREF);
using session::Clip;
using session::PMedia;

View file

@ -38,18 +38,20 @@
#include "lib/util.hpp"
using util::isSameObject;
namespace steam {
namespace mobject {
namespace session {
namespace test {
using namespace mobject::test;
typedef TestPlacement<TestSubMO21> PSub;
typedef PlacementMO::ID P_ID;
using util::isSameObject;
using LERR_(NOT_IN_SESSION);
using LERR_(BOTTOM_PLACEMENTREF);
using PSub = TestPlacement<TestSubMO21>;
using P_ID = PlacementMO::ID;
/***********************************************************************//**

View file

@ -44,12 +44,15 @@ using util::isSameObject;
using std::string;
namespace steam {
namespace steam {
namespace mobject {
namespace session {
namespace test {
using session::test::TestClip;
using LERR_(BOTTOM_PLACEMENTREF);
using LERR_(NONEMPTY_SCOPE);
using LERR_(INVALID_SCOPE);
typedef PlacementIndex& Idx;

View file

@ -35,10 +35,7 @@
#include "lib/util.hpp"
using util::isSameObject;
namespace steam {
namespace steam {
namespace mobject {
namespace session {
namespace test {
@ -61,6 +58,8 @@ namespace test {
}
}
using LERR_(NO_PARENT_SCOPE);
using util::isSameObject;
@ -72,7 +71,7 @@ namespace test {
* - discovers the scope of a placement
* - finds the parent scope
* - enumerates a scope path up to root
*
*
* @see mobject::Placement
* @see mobject::session::ScopePath
* @see mobject::session::QueryFocus
@ -81,7 +80,7 @@ namespace test {
{
virtual void
run (Arg)
run (Arg)
{
// Prepare an (test)Session
// with some dummy contents
@ -201,4 +200,4 @@ namespace test {
LAUNCHER (PlacementScope_test, "function session");
}}}} // namespace steam::mobject::session::test
}}}}// namespace steam::mobject::session::test

View file

@ -33,16 +33,14 @@
#include "lib/util.hpp"
namespace steam {
namespace steam {
namespace mobject {
namespace session {
namespace test {
using util::isnil;
using util::isSameObject;
using lumiera::error::LERR_(INVALID);
using LERR_(INVALID_SCOPE);
/***********************************************************************//**
@ -54,7 +52,7 @@ namespace test {
* some path frames to play with.
* @note this test executes a lot of functionality in a manual by-hand way,
* which in the actual application is accessed and utilised through
* QueryFocus objects as frontend.
* QueryFocus objects as frontend.
*
* @see mobject::session::QueryFocusStack
* @see mobject::session::ScopePath
@ -63,7 +61,7 @@ namespace test {
{
virtual void
run (Arg)
run (Arg)
{
// Prepare an (test)Index and
// set up dummy session contents
@ -251,4 +249,4 @@ namespace test {
LAUNCHER (QueryFocusStack_test, "unit session");
}}}} // namespace steam::mobject::session::test
}}}}// namespace steam::mobject::session::test

View file

@ -37,7 +37,7 @@
#include <string>
namespace steam {
namespace steam {
namespace mobject {
namespace session {
namespace test {
@ -46,9 +46,10 @@ namespace test {
using util::isnil;
using util::isSameObject;
using lumiera::error::LERR_(LOGIC);
using lumiera::error::LERR_(INVALID);
using LERR_(LOGIC);
using LERR_(INVALID_SCOPE);
using LERR_(NOT_IN_SESSION);
using LERR_(EMPTY_SCOPE_PATH);
@ -67,7 +68,7 @@ namespace test {
{
virtual void
run (Arg)
run (Arg)
{
// Prepare an (test)Index backing the PlacementRefs
PPIdx index = build_testScopes();
@ -294,7 +295,7 @@ namespace test {
path1 = path2; // but path without refcount may be overwritten
path1 = path3;
CHECK (path1 == path3);
intrusive_ptr_release (&path2); // refcount drops to zero...
CHECK (0 == path1.ref_count());
CHECK (0 == path2.ref_count());
@ -342,7 +343,7 @@ namespace test {
TestPlacement<> newNode (*new DummyMO);
PMO& parentRefPoint = parent.getTop();
Scope newLocation =
Scope newLocation =
index->find( // place newNode as sibling of "leaf"
index->insert (newNode, parentRefPoint));
path.navigate (newLocation); __SHOWPATH(5)
@ -383,7 +384,6 @@ namespace test {
CHECK (isSameObject (other.getTop(), separatePlacement));
ScopePath rootPrefix = commonPrefix (path,refPath);
CHECK (rootPrefix.endsAt (root));
}

View file

@ -56,7 +56,7 @@ namespace test{
ATTRIB2("β", int64_t(2)), // attribute α = 2L (int64_t)
ATTRIB3("γ", 3.45), // attribute γ = 3.45 (double)
TYPE_X("type", "ξ"), // a "magic" type attribute "Xi"
TYPE_Z("type", "ζ"), //
TYPE_Z("type", "ζ"), //
CHILD_A("a"), // unnamed string child node
CHILD_B('b'), // unnamed char child node
CHILD_T(Time(12,34,56,78)), // unnamed time value child
@ -66,7 +66,7 @@ namespace test{
}//(End)Test fixture
using LERR_(DIFF_CONFLICT);

View file

@ -52,8 +52,8 @@ namespace lib {
namespace diff{
namespace test{
using error::LERR_(WRONG_TYPE);
using error::LERR_(BOTTOM_VALUE);
using LERR_(WRONG_TYPE);
using LERR_(BOTTOM_VALUE);
namespace {//Test fixture....

View file

@ -47,9 +47,9 @@ namespace lib {
namespace diff{
namespace test{
using lumiera::error::LERR_(INVALID);
using lumiera::error::LERR_(INDEX_BOUNDS);
using lumiera::error::LERR_(BOTTOM_VALUE);
using LERR_(INVALID);
using LERR_(INDEX_BOUNDS);
using LERR_(BOTTOM_VALUE);
namespace {//Test fixture....

View file

@ -37,7 +37,7 @@
#include <string>
#include <vector>
using lumiera::error::LERR_(ITER_EXHAUST);
using LERR_(ITER_EXHAUST);
using lib::iter_stl::IterSnapshot;
using lib::iter_stl::snapshot;
using lib::time::Time;

View file

@ -55,7 +55,7 @@ namespace lib {
namespace diff{
namespace test{
using lumiera::error::LERR_(LOGIC);
using LERR_(LOGIC);
namespace {//Test fixture....

View file

@ -53,7 +53,7 @@ namespace lumiera {
LUMIERA_ERROR_DEFINE (DERIVED, "convoluted exception");
/** define a specific Error subclass derived from error::external */
using DerivedError = error::LumieraError<LERR_(DERIVED), error::External>;
using DerivedError = error::LumieraError<LUMIERA_ERROR_DERIVED, error::External>;
/******************************************************//**
@ -139,7 +139,7 @@ namespace lumiera {
*/
void checkErrorFlagPropagation()
{
lumiera_error_set(LERR_(LIFE_AND_UNIVERSE), "what is the answer?");
lumiera_error_set(LUMIERA_ERROR_LIFE_AND_UNIVERSE, "what is the answer?");
CHECK (lumiera_error_peek());
catcher (&test::detectErrorflag);

View file

@ -44,7 +44,7 @@ namespace lib {
namespace test{
using ::Test;
using lumiera::error::LERR_(ITER_EXHAUST);
using LERR_(ITER_EXHAUST);
using boost::lexical_cast;
using util::for_each;
using util::isnil;

View file

@ -50,7 +50,7 @@ namespace test{
using std::vector;
using std::string;
using lumiera::error::LERR_(ITER_EXHAUST);
using LERR_(ITER_EXHAUST);
namespace { // test fixture

Some files were not shown because too many files have changed in this diff Show more