Lumiera  0.pre.03
»edit your freedom«
error-log.cpp
Go to the documentation of this file.
1 /*
2  ErrorLog - Entity to collect and persist incident records
3 
4  Copyright (C)
5  2018, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 * *****************************************************************/
13 
14 
22 #include "steam/assetmanager.hpp"
23 //#include "lib/time/timevalue.hpp"
24 //#include "lib/format-string.hpp"
25 //#include "lib/util.hpp"
26 
27 //#include <string>
28 
29 //using util::_Fmt;
30 //using util::cStr;
31 //using util::isnil;
32 //using std::string;
33 using std::dynamic_pointer_cast;
34 
35 
36 namespace steam {
37 namespace asset{
38 namespace meta {
39 
40  namespace error = lumiera::error;
41 
42 
48  LogID theErrorLog_ID{"global_ErrorLog"};
49 
50 
52  ErrorLog::ErrorLog (LogID const& nameID)
53  : Meta{nameID}
54  { }
55 
56 
57  PLog
59  {
60  Asset::Ident ident = asset::idi::getAssetIdent (theErrorLog_ID, META);
61  ID<Asset> globalLogID = AssetManager::instance().getID(ident);
63 
64  if (not AssetManager::instance().known (globalLogID))
66  .commit();
67  else
68  return dynamic_pointer_cast<ErrorLog> (AssetManager::instance().getAsset (globalLogID));
69  }
70 
71 // using lib::time::Time;
72 // using lib::time::TimeValue;
73 
74 
83  {
84  ASSERT (nameID == theErrorLog_ID.getSym(), "only the single global Error Log is implemented for now");
86  }
87 
88 
89 }}} // namespace asset::meta
Steam-Layer Interface: Asset Lookup and Organisation.
key abstraction: metadata, parametrisation, customisation and similar organisational traits...
Definition: asset/meta.hpp:109
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:126
const Ident ident
Asset identification tuple.
Definition: asset.hpp:199
Steam-Layer implementation namespace root.
static lib::Depend< AssetManager > instance
get at the system-wide asset manager instance.
An entity to collect, possibly filter and persist incident records.
static MetaFactory create
storage for the static MetaFactory instance
Definition: asset/meta.hpp:114
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:149
represents some meta entity
static PLog global()
retrieve (possibly create) the global singleton asset corresponding to "the" global error log...
Definition: error-log.cpp:58
lib::idi::EntryID< ErrorLog > theErrorLog_ID
storage for an unique, globally known ID.
Definition: error-log.cpp:48
static lib::P< KIND > wrap(const KIND &asset)
retrieve the registered smart-ptr for any asset
Building and configuring a meta asset.
Definition: asset/meta.hpp:100
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
Receive, collect, filter and possibly persist incident records.
Definition: error-log.hpp:65
Naming and labelling scheme for structural assets.