Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
FieldID.cpp
Go to the documentation of this file.
1 //===-- serialbox/core/FieldID.cpp --------------------------------------------------*- C++ -*-===//
2 //
3 // S E R I A L B O X
4 //
5 // This file is distributed under terms of BSD license.
6 // See LICENSE.txt for more information
7 //
8 //===------------------------------------------------------------------------------------------===//
9 //
13 //===------------------------------------------------------------------------------------------===//
14 
15 #include "serialbox/core/FieldID.h"
16 #include <iostream>
17 
18 namespace serialbox {
19 
20 bool operator==(const FieldID& left, const FieldID& right) {
21  return ((left.name == right.name) && (left.id == right.id));
22 }
23 
24 bool operator!=(const FieldID& left, const FieldID& right) { return (!(left == right)); }
25 
26 std::ostream& operator<<(std::ostream& stream, const FieldID& f) {
27  return (stream << "{" << f.name << ", " << f.id << "}");
28 }
29 
30 } // namespace serialbox
unsigned int id
ID within the field.
Definition: FieldID.h:29
Namespace of the serialbox library.
Definition: Archive.h:25
Uniquely identifiy a field.
Definition: FieldID.h:27
std::string name
Name of the field.
Definition: FieldID.h:28
bool operator==(const FieldID &left, const FieldID &right)
Check for equality of FieldIDs.
Definition: FieldID.cpp:20
bool operator!=(const FieldID &left, const FieldID &right)
Check for inequality of FieldIDs.
Definition: FieldID.cpp:24
std::ostream & operator<<(std::ostream &stream, const FieldID &f)
Convert FieldID to stream.
Definition: FieldID.cpp:26