lumiera_/src/steam/engine/proc-id.hpp
Ichthyostega 5df93f01fc Invocation: pass symbolic spec through the node builder
...taking into account the prospecive usage context
where the builder expressions will be invoked from within
a media-library plug-in, using std::string_view to pass
the symbolic information seems like a good fit, because
the given spec will typically be assembled from some
building blocks, and thus in itself not be literal data.
2024-11-03 22:55:06 +01:00

97 lines
3 KiB
C++

/*
PROC-ID.hpp - symbolic and hash identification of processing steps
Copyright (C) Lumiera.org
2024, Hermann Vosseler <Ichthyostega@web.de>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/** @file proc-id.hpp
** Metadata interface to generate symbolic and hash ID tags for media processing steps.
** Functionality is provided to identify a point in the processing chain for sake of
** error reporting and unit testing; moreover, identifying information can be chained
** and combined into a systematic hash key, to serve as foundation for a stable cache key.
** @todo WIP-WIP as of 10/2024 this is a draft created as an aside while working towards
** the first integration of render engine functionality //////////////////////////////////////////////TICKET #1377 : establish a systematic processing identification
** @remark the essential requirement for a systematic and stable cache key is
** - to be be re-generated directly from the render node network
** - to be differing if and only if the underlying processing structure changes
**
** @see turnout.hpp
** @see engine::ProcNodeDiagnostic
** @see proc-node.cpp for the implementation backend
*/
#ifndef ENGINE_PROC_ID_H
#define ENGINE_PROC_ID_H
#include "lib/hash-standard.hpp"
#include "lib/error.hpp"
//#include "steam/streamtype.hpp"
#include <string>
namespace steam {
namespace engine {
namespace err = lumiera::error;
using lib::HashVal;
using std::string;
using StrView = std::string_view;
class ProcID
{
string nodeSymb_;
string portQual_;
string argLists_;
ProcID (StrView nodeSymb, StrView portQual, StrView argLists);
public:
/** build and register a processing ID descriptor */
static ProcID& describe (StrView nodeSymb, StrView portSpec);
/* === symbolic descriptors === */
string
genProcSpec()
{
return "Lalü";
}
friend bool
operator== (ProcID const& l, ProcID const& r)
{
return l.nodeSymb_ == r.nodeSymb_
and l.portQual_ == r.portQual_
and l.argLists_ == r.argLists_;
}
friend bool
operator!= (ProcID const& l, ProcID const& r)
{ return not (l == r); }
};
HashVal hash_value (ProcID const&);
}} // namespace steam::engine
#endif /*ENGINE_PROC_ID_H*/