<commit_before>/**
framenotifier_data.h

  Created on: 15 Oct 2015
      Author: up45
*/

#ifndef TOOLS_CLIENT_FRAMENOTIFIER_DATA_H_
#define TOOLS_CLIENT_FRAMENOTIFIER_DATA_H_

#include <string>
#include <stdint.h>

#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/mapped_region.hpp>

#include <log4cxx/logger.h>


//===========================================================================================
//    Bits stolen directly from the frameReceiver Percival Emulator header
//    - should make it into a public header file
//
//
//    Memory layout of a full frame from Python Emulator in shared memory:
//
//    0x000000 [[Data Frame][FrameHeader size=1056 bytes]
//    0x000420 [            [Subframe 0][UDP packet 0 size=8192 bytes]
//    0x002420                          [UDP packet 1]
//    0x004420                          [UDP packet 2]
//                                      ...
//    0x1FC420                          [UDP packet 254]
//    0x1FE420                          [UDP packet 255 size=512 bytes]
//    0x1FE620              [Subframe 1][UDP packet 0]                    subframe size: (8192 x 255) + 512 = 2089472 bytes
//                          ...
//             ]
//    0x3FC820 [[Reset Frame][FrameHeader size=1056 bytes]]
//
//    In terms of pixels, the python emulator creates a P2M image of:
//        width x  = 2 x 22 x 32 = 1404 pixels
//        height y = 2 x 106 x 7 = 1484 pixels
//

static const size_t udp_packet_header_size = 22;
static const size_t primary_packet_size = 8192;
static const size_t num_primary_packets = 255;
static const size_t tail_packet_size    = 512;
static const size_t num_tail_packets    = 1;
static const size_t num_subframes       = 2;
static const size_t num_data_types      = 2;
<commit_msg>filewriter: updated comment with data/reset memory layout<commit_after>/**
framenotifier_data.h

  Created on: 15 Oct 2015
      Author: up45
*/

#ifndef TOOLS_CLIENT_FRAMENOTIFIER_DATA_H_
#define TOOLS_CLIENT_FRAMENOTIFIER_DATA_H_

#include <string>
#include <stdint.h>

#include <boost/interprocess/shared_memory_object.hpp>
#include <boost/interprocess/mapped_region.hpp>

#include <log4cxx/logger.h>


//===========================================================================================
//    Bits stolen directly from the frameReceiver Percival Emulator header
//    - should make it into a public header file
//
//
//    Memory layout of a full frame from Python Emulator in shared memory:
//
//    0x000000 [[Data Frame][FrameHeader size=1056 bytes]
//    0x000420 [            [Subframe 0][UDP packet 0 size=8192 bytes]
//    0x002420                          [UDP packet 1]
//    0x004420                          [UDP packet 2]
//                                      ...
//    0x1FC420                          [UDP packet 254]
//    0x1FE420                          [UDP packet 255 size=512 bytes]
//    0x1FE620              [Subframe 1][UDP packet 0]                    subframe size: (8192 x 255) + 512 = 2089472 bytes
//                          ...
//             ]
//    0x3FC820 [[Reset Frame][[Subframe 0][UDP packet 0 size=8192 bytes]]
//                          ...
//
//    In terms of pixels, the python emulator creates a P2M image of:
//        width x  = 2 x 22 x 32 = 1408 pixels
//        height y = 2 x 106 x 7 = 1484 pixels
//

static const size_t udp_packet_header_size = 22;
static const size_t primary_packet_size = 8192;
static const size_t num_primary_packets = 255;
static const size_t tail_packet_size    = 512;
static const size_t num_tail_packets    = 1;
static const size_t num_subframes       = 2;
static const size_t num_data_types      = 2;

{'fraction_non_alphanumeric': 0.1323608860075635, 'fraction_numerical': 0.07347379794705565, 'mean_word_length': 2.114381833473507, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1326741', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1102, 'n_words': 339}