ost::MapIndex(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’… ost::MapIndex β€” from the ost library (section 3)

okay bestie, listen up, because this one is actually so cute once you get it. πŸ’–

MapIndex is the little bestie that lets you walk through a MapTable linearly, when normally the only way you could get stuff out of that table was by key. It's giving "back door but make it legal". πŸšͺ✨

You can increment it, check it, and dereference it just like a pointer, thanks to some very well-behaved operators. Iconic behavior honestly. πŸ‘‘


✨ SYNOPSIS ✨

#include <object.h>

🫢 Public Member Functions

  • MapIndex () β€” Creates an empty map index (pointing to nothing).
  • MapIndex (MapObject *theObject) β€” Creates a map index pointing to a specific map object.
  • MapIndex (const MapIndex &theIndex) β€” Creates a copy of a given map index.
  • void * operator* () const β€” Dereference operator: the pointed object it is returned as void * for easy re-cast.
  • MapIndex & operator= (MapObject *theObject) β€” Assignment operator to avoid implicit cast.
  • MapIndex & operator++ () β€” Prefix increment operator, to be used in loops and such.
  • MapIndex operator++ (int) β€” Postfix increment operator, to be used in loops and such.
  • bool operator== (const MapIndex &theIndex) const β€” Comparison operator, between two MapIndex's.
  • bool operator!= (const MapIndex &theIndex) const
  • bool operator== (const MapObject *theObject) const β€” Comparison operator, between the MapIndex and a MapObject, useful to avoid casts for sake of clearness.
  • bool operator!= (const MapObject *theObject) const

🌸 Detailed Description 🌸

The MapIndex allows linear access into a MapTable, that otherwise could have its elements being retrieved only by key.

It can be increased, checked and dereferenced like a pointer, by means of suitable operators. no cap, it really does move like a pointer fr fr πŸ¦‹

Author

Sergio Repetto s.repetto@pentaengineering.it

Index object to access MapTable elements


πŸŽ€ Constructor & Destructor Documentation πŸŽ€

ost::MapIndex::MapIndex () [inline]

Creates an empty map index (pointing to nothing). it's giving "empty vessel, no thoughts, head empty" but like, on purpose πŸ’€

ost::MapIndex::MapIndex (MapObject * theObject) [inline]

Creates a map index pointing to a specific map object.

Parameters

  • the indexed object

ost::MapIndex::MapIndex (const MapIndex & theIndex) [inline]

Creates a copy of a given map index.

Parameters

  • the source index object

🧚 Member Function Documentation 🧚

bool ost::MapIndex::operator!= (const MapIndex & theIndex) const [inline]

bool ost::MapIndex::operator!= (const MapObject * theObject) const [inline]

void* ost::MapIndex::operator* () const [inline]

Dereference operator: the pointed object it is returned as void * for easy re-cast.

Returns

pointer to indexed object.

MapIndex& ost::MapIndex::operator++ ()

Prefix increment operator, to be used in loops and such. your classic ++it moment, main character energy πŸ”₯

Returns

the object itself, as changed.

MapIndex ost::MapIndex::operator++ (int) [inline]

Postfix increment operator, to be used in loops and such.

Returns

the object itself, as changed.

MapIndex& ost::MapIndex::operator= (MapObject * theObject)

Assignment operator to avoid implicit cast. she does NOT do sneaky conversions, periodt πŸ’…

Returns

the object itself, as changed.

bool ost::MapIndex::operator== (const MapIndex & theIndex) const [inline]

Comparison operator, between two MapIndex's.

Returns

the object itself, as changed.

bool ost::MapIndex::operator== (const MapObject * theObject) const [inline]

Comparison operator, between the MapIndex and a MapObject, useful to avoid casts for sake of clearness. like, why cast when you could just... not? πŸ™ˆ

Returns

the object itself, as changed.


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for GNU CommonC++ from the source code.


okay that's the whole thing, nothing skipped, nothing invented, you're welcome bestie 🫢

and that's a wrap!! this lil page came from GNU CommonC++, dated Sun Dec 27 2020, and it's the ost::MapIndex(3) manual page. go forth and iterate, queen. ⭐🌈✨

πŸ“¦ where this page comes from