Jpp 20.0.0-195-g190c9e876
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 158 of file JSydney.cc.

Constructor & Destructor Documentation

◆ ids_t() [1/3]

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

Default constructor.

Definition at line 164 of file JSydney.cc.

165 {}

◆ 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 173 of file JSydney.cc.

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

◆ 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 185 of file JSydney.cc.

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

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 198 of file JSydney.cc.

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

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 215 of file JSydney.cc.

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

◆ 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 236 of file JSydney.cc.

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

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