OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
src
ippl
src
Message
Format.h
Go to the documentation of this file.
1
//
2
// Class Format
3
// Format class to allow serializing message objects into plain buffers
4
// to send directly with mpi calls or similar means
5
//
6
// Copyright (c) 2008 - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
7
// All rights reserved
8
//
9
// This file is part of OPAL.
10
//
11
// OPAL is free software: you can redistribute it and/or modify
12
// it under the terms of the GNU General Public License as published by
13
// the Free Software Foundation, either version 3 of the License, or
14
// (at your option) any later version.
15
//
16
// You should have received a copy of the GNU General Public License
17
// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18
//
19
#ifndef FORMATTER_H
20
#define FORMATTER_H
21
22
#include <algorithm>
23
#include <cstring>
24
#include <vector>
25
#include "
Message/Message.h
"
26
27
class
Format
{
28
public
:
29
Format
(
Message
*);
30
unsigned
int
getItemCount
() {
31
return
items
;
32
}
33
unsigned
int
getSize
() {
34
return
size
;
35
}
36
unsigned
int
getFormatSize
() {
37
return
2 *
items
*
sizeof
(int);
38
}
39
unsigned
int
getItemElems
(
int
i) {
40
return
format_array
[2 * i + 0];
41
}
42
unsigned
int
getItemBytes
(
int
i) {
43
return
format_array
[2 * i + 1];
44
}
45
46
void
print
();
47
48
private
:
49
unsigned
int
items
,
size
;
50
std::vector<unsigned int>
format_array
;
51
};
52
53
#endif
Message.h
Format
Definition:
Format.h:27
Format::Format
Format(Message *)
Definition:
Format.cpp:21
Format::getItemBytes
unsigned int getItemBytes(int i)
Definition:
Format.h:42
Format::size
unsigned int size
Definition:
Format.h:49
Format::items
unsigned int items
Definition:
Format.h:49
Format::getSize
unsigned int getSize()
Definition:
Format.h:33
Format::getItemCount
unsigned int getItemCount()
Definition:
Format.h:30
Format::getFormatSize
unsigned int getFormatSize()
Definition:
Format.h:36
Format::print
void print()
Definition:
Format.cpp:36
Format::format_array
std::vector< unsigned int > format_array
Definition:
Format.h:50
Format::getItemElems
unsigned int getItemElems(int i)
Definition:
Format.h:39
Message
Definition:
Message.h:143
Generated on Wed Aug 25 2021 16:40:59 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.1