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) Lumiera.org
5  2018, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
31 #include "steam/assetmanager.hpp"
32 //#include "lib/time/timevalue.hpp"
33 //#include "lib/format-string.hpp"
34 //#include "lib/util.hpp"
35 
36 //#include <string>
37 
38 //using util::_Fmt;
39 //using util::cStr;
40 //using util::isnil;
41 //using std::string;
42 using std::dynamic_pointer_cast;
43 
44 
45 namespace steam {
46 namespace asset{
47 namespace meta {
48 
49  namespace error = lumiera::error;
50 
51 
57  LogID theErrorLog_ID{"global_ErrorLog"};
58 
59 
61  ErrorLog::ErrorLog (LogID const& nameID)
62  : Meta{nameID}
63  { }
64 
65 
66  PLog
68  {
69  Asset::Ident ident = asset::idi::getAssetIdent (theErrorLog_ID, META);
70  ID<Asset> globalLogID = AssetManager::instance().getID(ident);
72 
73  if (not AssetManager::instance().known (globalLogID))
75  .commit();
76  else
77  return dynamic_pointer_cast<ErrorLog> (AssetManager::instance().getAsset (globalLogID));
78  }
79 
80 // using lib::time::Time;
81 // using lib::time::TimeValue;
82 
83 
92  {
93  ASSERT (nameID == theErrorLog_ID.getSym(), "only the single global Error Log is implemented for now");
95  }
96 
97 
98 }}} // namespace asset::meta
Steam-Layer Interface: Asset Lookup and Organisation.
key abstraction: metadata, parametrisation, customisation and similar organisational traits...
Definition: asset/meta.hpp:118
typed symbolic and hash ID for asset-like position accounting.
Definition: entry-id.hpp:135
const Ident ident
Asset identification tuple.
Definition: asset.hpp:208
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:123
a POD comprised of all the information sufficiently identifying any given Asset.
Definition: asset.hpp:158
represents some meta entity
static PLog global()
retrieve (possibly create) the global singleton asset corresponding to "the" global error log...
Definition: error-log.cpp:67
lib::idi::EntryID< ErrorLog > theErrorLog_ID
storage for an unique, globally known ID.
Definition: error-log.cpp:57
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:109
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:78
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
Receive, collect, filter and possibly persist incident records.
Definition: error-log.hpp:74
Naming and labelling scheme for structural assets.