Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JACOUSTICS::JSydney::ids_t Struct Reference

List of object identifiers. More...

Inheritance diagram for JACOUSTICS::JSydney::ids_t:
std::set< int >

Public Member Functions

 ids_t ()
 Default constructor.
 
 ids_t (const std::vector< int > &buffer)
 Copy constructor.
 
 ids_t (const ids_t &A, const ids_t &B)
 Difference constructor.
 
void fix (const ids_t &B)
 Fix.
 

Friends

std::istream & operator>> (std::istream &in, ids_t &object)
 Read identifiers from input stream.
 
std::ostream & operator<< (std::ostream &out, const ids_t &object)
 Write identifiers to output stream.
 

Detailed Description

List of object identifiers.

Definition at line 157 of file JSydney.cc.

Constructor & Destructor Documentation

◆ ids_t() [1/3]

JACOUSTICS::JSydney::ids_t::ids_t ( )
inline

Default constructor.

Definition at line 163 of file JSydney.cc.

164 {}

◆ ids_t() [2/3]

JACOUSTICS::JSydney::ids_t::ids_t ( const std::vector< int > & buffer)
inline

Copy constructor.

Parameters
bufferlist of identifiers

Definition at line 172 of file JSydney.cc.

172 :
173 std::set<int>(buffer.begin(), buffer.end())
174 {}

◆ ids_t() [3/3]

JACOUSTICS::JSydney::ids_t::ids_t ( const ids_t & A,
const ids_t & B )
inline

Difference constructor.

Make list of all object identifiers in A that are not in B.

Parameters
Alist of identifiers
Blist of identifiers

Definition at line 184 of file JSydney.cc.

186 {
187 std::set_difference(A.begin(), A.end(), B.begin(), B.end(), std::inserter(*this, this->begin()));
188 }

Member Function Documentation

◆ fix()

void JACOUSTICS::JSydney::ids_t::fix ( const ids_t & B)
inline

Fix.

Keep list of object identifiers that are not in B.

Parameters
Blist of identifiers

Definition at line 197 of file JSydney.cc.

198 {
199 ids_t A;
200
201 this->swap(A);
202
203 std::set_difference(A.begin(), A.end(), B.begin(), B.end(), std::inserter(*this, this->begin()));
204 }
ids_t()
Default constructor.
Definition JSydney.cc:163

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
ids_t & object )
friend

Read identifiers from input stream.

Parameters
ininput stream
objectidentifiers
Returns
input stream

Definition at line 214 of file JSydney.cc.

215 {
216 for (int id; in >> id; ) {
217 object.insert(id);
218 }
219
220 if (!in.bad()) {
221 in.clear();
222 }
223
224 return in;
225 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const ids_t & object )
friend

Write identifiers to output stream.

Parameters
outoutput stream
objectidentifiers
Returns
output stream

Definition at line 235 of file JSydney.cc.

236 {
237 for (const int id : object) {
238 out << ' ' << id;
239 }
240
241 return out;
242 }

The documentation for this struct was generated from the following file: