Lumiera  0.pre.03
»edit your freedom«
session-cmd.cpp
Go to the documentation of this file.
1 /*
2  SessionCmd - actual steam command scripts for session-global actions
3 
4  Copyright (C)
5  2017, 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 
28 #include "steam/cmd.hpp"
31 //#include "lib/symbol.hpp"
32 #include "lib/idi/entry-id.hpp"
33 //#include "lib/format-string.hpp"
34 
35 //#include <string>
36 
37 using lib::hash::LuidH;
38 //using std::string;
39 //using util::cStr;
40 //using util::_Fmt;
41 
42 
43 namespace steam {
44 namespace cmd {
45  namespace error = lumiera::error;
46 
47  using mobject::Session;
48 
49  namespace { // implementation helper...
50  }//(End) implementation helper
51 
52 
53 
54 
58  COMMAND_DEFINITION (session_saveSnapshot)
59  {
60  def.operation ([](string snapshotID)
61  {
62  Session::current.save (snapshotID);
63  })
64  .captureUndo ([](string snapshotID) -> string
65  {
66  return snapshotID;
67  })
68  .undoOperation ([](string, string oldSnapshot)
69  {
70  UNIMPLEMENTED ("how to remove a snapshot from session history");
71  });
72  };
73 
74 
79  COMMAND_DEFINITION (session_newSequence)
80  {
81  def.operation ([](LuidH context, LuidH newID)
82  {
83  UNIMPLEMENTED ("add a new Sequence into the given context scope within the Session");
84  })
85  .captureUndo ([](LuidH, LuidH addedSeq) -> LuidH
86  {
87  return addedSeq;
88  })
89  .undoOperation ([](LuidH context, LuidH addedSeq, LuidH newID)
90  {
91  REQUIRE (addedSeq == newID);
92  UNIMPLEMENTED ("how to remove a sub-sequence from the given context");
93  });
94  };
95 
96 
97 
98 
103 }} // namespace steam::cmd
#define COMMAND_DEFINITION(_NAME_)
Macro to write command definitions in a compact form.
Common ID definitions for Steam-Layer commands.
static session::SessManager & current
access point to the current Session
Definition: session.hpp:120
Steam-Layer implementation namespace root.
virtual void save(string snapshotID)=0
create a complete, serialised representation of the current session config and contents.
Hash implementation based on a lumiera unique object id (LUID) When invoking the default ctor...
Bare symbolic and hash ID used for accounting of asset like entries.
Primary Interface to the current Session.
Actually defining a command and binding it to execution parameters.