STL Memory Versioning
Classes | Functions
revision.h File Reference

Implementation of the class Revision. More...

#include <thread>
#include <memory>
#include <iostream>
#include <functional>
Include dependency graph for revision.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Revision
 Revision class for for keeping track of segment branches. More...
 

Functions

void PrintRevision (std::shared_ptr< Revision > revision)
 Print revision segments for debugging. More...
 

Detailed Description

Implementation of the class Revision.

Definition in file revision.h.

Function Documentation

◆ PrintRevision()

void PrintRevision ( std::shared_ptr< Revision revision)

Print revision segments for debugging.

Definition at line 19 of file revision.cpp.

19  {
20  if (revision == nullptr) {
21  std::cout << "Revision is null" << std::endl;
22  return;
23  }
24 
25  std::shared_ptr<Segment> s = revision->current;
26 
27  std::ostringstream o;
28  o << std::endl;
29  while (s) {
30  o << "thread: "<< std::this_thread::get_id() << ", segment ver:" << s->version
31  << ", addr: " << s << ", refcount: " << s->refcount << ", written size: " << s->written.size() << std::endl;
32  s = s->parent;
33  }
34 
35  std::cout << o.str() << std::endl;
36 }