Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JACOUSTICS::JSydney::ids_t Struct Reference

Map object identifiers to fit options. More...

Inheritance diagram for JACOUSTICS::JSydney::ids_t:
std::map< int, fit_t >

Public Types

typedef std::map< int, fit_t > map_type
 

Public Member Functions

 ids_t ()
 Default constructor.
 
 ids_t (const array_type< int > &buffer)
 Copy constructor.
 
 ids_t (const ids_t &A, const ids_t &B)
 Difference constructor.
 
void insert (const int id)
 Insert identifier.
 
void erase (const ids_t &B)
 Erase elements that are in given list of identifiers.
 
template<class T >
void set (const ids_t &B, const T &OP)
 Set fit options of elements to result of given logical operator combined with fit options in given list of identifiers.
 
void set (const char c, const bool value)
 Set fit option of all elements for given coordinate.
 

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 and fit options to output stream.
 

Detailed Description

Map object identifiers to fit options.

Definition at line 196 of file JSydney.cc.

Member Typedef Documentation

◆ map_type

Constructor & Destructor Documentation

◆ ids_t() [1/3]

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

Default constructor.

Definition at line 208 of file JSydney.cc.

209 {}

◆ ids_t() [2/3]

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

Copy constructor.

Parameters
bufferlist of identifiers

Definition at line 217 of file JSydney.cc.

218 {
219 for (const int i : buffer) {
220 this->insert(i);
221 }
222 }
void insert(const int id)
Insert identifier.
Definition JSydney.cc:245

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

233 :
234 ids_t(A)
235 {
236 erase(B);
237 }
void erase(const ids_t &B)
Erase elements that are in given list of identifiers.
Definition JSydney.cc:256
ids_t()
Default constructor.
Definition JSydney.cc:208

Member Function Documentation

◆ insert()

void JACOUSTICS::JSydney::ids_t::insert ( const int id)
inline

Insert identifier.

Parameters
ididentifier

Definition at line 245 of file JSydney.cc.

246 {
247 this->insert(std::make_pair(id, fit_t()));
248 }

◆ erase()

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

Erase elements that are in given list of identifiers.

Parameters
Blist of identifiers

Definition at line 256 of file JSydney.cc.

257 {
258 for (const auto& i : B) {
259 this->erase(i.first);
260 }
261 }

◆ set() [1/2]

template<class T >
void JACOUSTICS::JSydney::ids_t::set ( const ids_t & B,
const T & OP )
inline

Set fit options of elements to result of given logical operator combined with fit options in given list of identifiers.

Parameters
Blist of identifiers
OPoperator

Definition at line 271 of file JSydney.cc.

272 {
273 for (const auto i : B) {
274
275 iterator p = this->find(i.first);
276
277 if (p != this->end()) {
278 p->second.x = OP(p->second.x, i.second.x);
279 p->second.y = OP(p->second.y, i.second.y);
280 p->second.z = OP(p->second.z, i.second.z);
281 }
282 }
283 }

◆ set() [2/2]

void JACOUSTICS::JSydney::ids_t::set ( const char c,
const bool value )
inline

Set fit option of all elements for given coordinate.

Parameters
ccoordinate
valuevalue

Definition at line 292 of file JSydney.cc.

293 {
294 for (iterator i = this->begin(); i != this->end(); ++i) {
295 i->second.set(c, value);
296 }
297 }

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

308 {
309 for (int id; in >> id; ) {
310 object.insert(id);
311 }
312
313 if (!in.bad()) {
314 in.clear();
315 }
316
317 return in;
318 }

◆ operator<<

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

Write identifiers and fit options to output stream.

Parameters
outoutput stream
objectidentifiers
Returns
output stream

Definition at line 328 of file JSydney.cc.

329 {
330 for (const auto& i : object) {
331 out << ' ' << i.first
332 << '.'
333 << (i.second.x ? X_t : ' ')
334 << (i.second.y ? Y_t : ' ')
335 << (i.second.z ? Z_t : ' ');
336 }
337
338 return out;
339 }
static const char Z_t
set z-coordinate
Definition JSydney.cc:97
static const char Y_t
set y-coordinate
Definition JSydney.cc:96
static const char X_t
set x-coordinate
Definition JSydney.cc:95

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