Numworks Epsilon  1.4.1
Graphing Calculator Operating System
apps_container_storage.cpp
Go to the documentation of this file.
2 
3 #ifndef APPS_CONTAINER_SNAPSHOT_CONSTRUCTORS
4 #error Missing snapshot constructors
5 #endif
6 
7 #ifndef APPS_CONTAINER_SNAPSHOT_LIST
8 #error Missing snapshot list
9 #endif
10 
11 #ifndef APPS_CONTAINER_SNAPSHOT_COUNT
12 #error Missing snapshot count
13 #endif
14 
15 constexpr int k_numberOfCommonApps = 1+APPS_CONTAINER_SNAPSHOT_COUNT; // Take the Home app into account
16 
18  static AppsContainerStorage appsContainerStorage;
19  return &appsContainerStorage;
20 }
21 
24  APPS_CONTAINER_SNAPSHOT_CONSTRUCTORS
25 {
26 }
27 
29  return k_numberOfCommonApps;
30 }
31 
33  if (index < 0) {
34  return nullptr;
35  }
36  App::Snapshot * snapshots[] = {
38  APPS_CONTAINER_SNAPSHOT_LIST
39  };
40  assert(sizeof(snapshots)/sizeof(snapshots[0]) == k_numberOfCommonApps);
41  assert(index >= 0 && index < k_numberOfCommonApps);
42  return snapshots[index];
43 }
App::Snapshot * appSnapshotAtIndex(int index) override
#define assert(e)
Definition: assert.h:9
Home::App::Snapshot * homeAppSnapshot()
static AppsContainerStorage * sharedContainer()
int numberOfApps() override
constexpr int k_numberOfCommonApps