rg3 / cifras

Program to solve the numeric problems from the Spanish TV show "Cifras y Letras"

This URL has Read+Write access

cifras / memory_manager.h
100644 27 lines (23 sloc) 0.635 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
* Author: Ricardo Garcia Gonzalez
* License: Public domain code
*/
#ifndef __MEMORY_MANAGER_HEADER__
#define __MEMORY_MANAGER_HEADER__
 
class MemoryManager {
public:
static MemoryManager *instance();
Operation *build_operation(OpCode code, long left, long right);
Node *build_node(const std::list<const Operation *> &prev_steps,
long new_num, long target,
const std::list<long> &basics,
std::set<std::list<long> > &explored_nodes,
Node *parent);
void free();
 
private:
MemoryManager();
std::list<const Operation *> operations;
std::list<const Node *> nodes;
static MemoryManager *theinstance;
};
 
#endif