Jpp 21.0.0-rc.3
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_tmap_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 198 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 210 of file JSydney.cc.

211 {}

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

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

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

235 :
236 ids_t(A)
237 {
238 erase(B);
239 }
void erase(const ids_t &B)
Erase elements that are in given list of identifiers.
Definition JSydney.cc:258
ids_t()
Default constructor.
Definition JSydney.cc:210

Member Function Documentation

◆ insert()

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

Insert identifier.

Parameters
ididentifier

Definition at line 247 of file JSydney.cc.

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

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

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

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

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

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

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

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

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

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

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

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