Symbol: clean-up of some occasional usages
hereby overlooking the elephant in the room: EntryID could switch to Symbol now
This commit is contained in:
parent
baa4111358
commit
3f17e6558e
7 changed files with 23 additions and 12 deletions
|
|
@ -107,7 +107,7 @@
|
|||
namespace lumiera{
|
||||
namespace advice {
|
||||
|
||||
using lib::Symbol;
|
||||
using lib::Literal;
|
||||
using util::isSameObject;
|
||||
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ namespace advice {
|
|||
}
|
||||
catch(...)
|
||||
{
|
||||
Symbol errID = lumiera_error();
|
||||
Literal errID = lumiera_error();
|
||||
releaseBuffer (storage, sizeof(Holder));
|
||||
throw lumiera::error::Fatal ("Failure to store advice data", errID);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@
|
|||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
using lib::Symbol;
|
||||
using lib::Literal;
|
||||
using lib::DelStash;
|
||||
using util::unConst;
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ namespace advice {
|
|||
|
||||
catch(...)
|
||||
{
|
||||
Symbol errID = lumiera_error();
|
||||
Literal errID = lumiera_error();
|
||||
WARN (library, "Problems on deregistration of advice request: %s", errID.c());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -409,8 +409,13 @@ namespace util {
|
|||
|
||||
template<>
|
||||
struct _Fmt::Converter<lib::Symbol>
|
||||
: _Fmt::Converter<lib::Literal>
|
||||
{ };
|
||||
{
|
||||
static void
|
||||
dump (lib::Symbol const& symbol, Implementation& impl)
|
||||
{
|
||||
format (symbol.c(), impl);
|
||||
}
|
||||
};
|
||||
|
||||
/** some custom types explicitly provide a string representation */
|
||||
template<typename VAL>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ namespace lumiera {
|
|||
{
|
||||
bool isNew = LifecycleRegistry::instance().enrol (eventLabel,callbackFun);
|
||||
|
||||
if (isNew && !strcmp(ON_BASIC_INIT, eventLabel))
|
||||
if (isNew and eventLabel == ON_BASIC_INIT)
|
||||
callbackFun(); // when this code executes,
|
||||
// then per definition we are already post "basic init"
|
||||
// (which happens in the AppState ctor); thus fire it immediately
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@
|
|||
#define LIB_SYMBOL_H
|
||||
|
||||
#include "lib/hash-standard.hpp"
|
||||
#include "include/logging.h" /////////////TODO only temporarily
|
||||
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
|
|
@ -51,9 +50,7 @@
|
|||
namespace lib {
|
||||
|
||||
/** inline string literal
|
||||
* @todo improve interaction with Symbol
|
||||
* @todo make it non-nullable
|
||||
* @todo maybe use boost/operators Ticket #417
|
||||
* This is a marker type to handle literally given C-Strings.
|
||||
*/
|
||||
class Literal
|
||||
{
|
||||
|
|
@ -126,6 +123,12 @@ namespace lib {
|
|||
|
||||
explicit operator bool() const { return not empty(); }
|
||||
bool empty() const { return *this == BOTTOM; }
|
||||
|
||||
size_t
|
||||
length() const
|
||||
{
|
||||
return std::strlen(c());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ namespace control {
|
|||
findDefinition (Command const& cmdInstance) const
|
||||
{
|
||||
Lock sync(this);
|
||||
return getValue_or_default (ridx_, &cmdInstance, 0 );
|
||||
return getValue_or_default (ridx_, &cmdInstance, Symbol::BOTTOM );
|
||||
} //used as Key
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ namespace test {
|
|||
CHECK (c2);
|
||||
CHECK (c2.canExec());
|
||||
CHECK (!c2.canUndo());
|
||||
CHECK (c2.isAnonymous());
|
||||
|
||||
CHECK (c1 == c2);
|
||||
CHECK (!isSameObject(c1, c2));
|
||||
|
|
@ -267,6 +268,8 @@ namespace test {
|
|||
CHECK (c4);
|
||||
CHECK (c4.canExec());
|
||||
CHECK (c4.canUndo());
|
||||
CHECK (not c4.isAnonymous());
|
||||
CHECK ( c2.isAnonymous());
|
||||
CHECK (c4 == c2);
|
||||
CHECK (c4 != c1);
|
||||
c4();
|
||||
|
|
|
|||
Loading…
Reference in a new issue