feisty meow concerns codebase  2.140
entity_registry.cpp
Go to the documentation of this file.
1 /*****************************************************************************\
2 * *
3 * Name : entity_registry *
4 * Author : Chris Koeritz *
5 * *
6 *******************************************************************************
7 * Copyright (c) 2002-$now By Author. This program is free software; you can *
8 * redistribute it and/or modify it under the terms of the GNU General Public *
9 * License as published by the Free Software Foundation; either version 2 of *
10 * the License or (at your option) any later version. This is online at: *
11 * http://www.fsf.org/copyleft/gpl.html *
12 * Please send any updates to: fred@gruntose.com *
13 \*****************************************************************************/
14 
15 #include "entity_registry.h"
16 
17 #include <mathematics/chaos.h>
18 #include <processes/safe_roller.h>
19 #include <octopus/entity_defs.h>
20 
21 using namespace basis;
22 using namespace mathematics;
23 using namespace processes;
24 using namespace timely;
25 
26 namespace octopi {
27 
28 entity_registry::entity_registry()
29 : _sequencer(new safe_roller(1, MAXINT32 / 2)),
30  _rando(new chaos)
31 {
32 }
33 
35 {
36  WHACK(_sequencer);
37  WHACK(_rando);
38 }
39 
41 
43 { return "blank_entity_registry--all are allowed, none are remembered."; }
44 
46  time_stamp &last_active, byte_array &verification)
47 {
48  last_active = time_stamp();
49  verification = byte_array();
50  return true;
51 }
52 
53 } //namespace.
54 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
A very common template for a dynamic array of bytes.
Definition: byte_array.h:36
a platform-independent way to acquire random numbers in a specific range.
Definition: chaos.h:51
basis::astring text_form()
prints out the contents of the entity registry.
bool locate_entity(const octopus_entity &entity, timely::time_stamp &last_active, basis::byte_array &verification)
retrieves the security records for the "entity", if any exist.
Provides a way of identifying users of an octopus object.
Definition: entity_defs.h:35
Implements a thread-safe roller object.
Definition: safe_roller.h:30
Represents a point in time relative to the operating system startup time.
Definition: time_stamp.h:38
#define formal(parameter)
This macro just eats what it's passed; it marks unused formal parameters.
Definition: definitions.h:48
#define MAXINT32
Maximum 32-bit integer value.
Definition: definitions.h:75
The guards collection helps in testing preconditions and reporting errors.
Definition: array.h:30
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
Definition: functions.h:121
An extension to floating point primitives providing approximate equality.
Definition: averager.h:21
#include <time.h>
Definition: earth_time.cpp:37
chaos _rando