SbName(3)

πŸ“¦ version 3.1.3, in fedora 43, fedora 44

πŸ’– SbName β€” the manual, but make it make sense πŸ’–

okay bestie, welcome to the SbName page from the Coin library manual (section 3, library functions, for the record). it's a whole vibe. let's go πŸ¦‹


✨ NAME ✨

SbName β€” the SbName class stores strings by reference. that's it, that's the name section, iconic.


🌸 SYNOPSIS 🌸

#include <Inventor/SbName.h>

πŸŽ€ Public Member Functions

SbName (void)
SbName (const char *namestring)
SbName (const SbString &str)
SbName (const SbName &name)
~SbName ()
const char * getString (void) const
int getLength (void) const
int operator! (void) const
operator const char * (void) const

πŸ’… Static Public Member Functions

static SbBool isIdentStartChar (const char c)
static SbBool isIdentChar (const char c)
static SbBool isBaseNameStartChar (const char c)
static SbBool isBaseNameChar (const char c)
static const SbName & empty (void)

πŸ‘‘ Detailed Description πŸ‘‘

so, SbName stores strings by reference. the class is used by Coin for storing keywords, names and other strings. and the way it stores them? identical strings are guaranteed to map to the same memory address (as returned by the SbName::getString() method). fr fr.

the main advantage of storing identical strings at the same memory address is that it simplifies comparison operations β€” especially when you're working with string data as keys in other data structures, like e.g. in hash (dictionary) tables. it's giving efficiency.

apart from that, mapping identical strings to the same memory address can also save on memory resources, and provide run-time optimizations. string comparisons for SbName objects are very efficient, for instance. slay.

⚠️ bestie, listen. there's an aspect of using SbName instances that it is important to be aware of: since strings are stored permanently, using SbName instances in code where there is continually changing strings or the continual addition of new unique strings will in the end swamp memory resources. so where possible, use SbString instances instead. no cap. 🫢

See also

  • SbString

🧚 Constructor & Destructor Documentation 🧚

SbName::SbName (void )

this is the default constructor. the humble beginning. πŸ™ˆ

SbName::SbName (const char * namestring)

constructor. adds the namestring string to the name table. ✨

SbName::SbName (const SbString & str)

constructor. adds str to the name table. πŸ’«

SbName::SbName (const SbName & name)

copy constructor. πŸ’–

SbName::~SbName ()

the destructor. bye bestie πŸ‘‹


πŸ’œ Member Function Documentation πŸ’œ

const char * SbName::getString (void ) const

this method returns pointer to character array for the name.

the returned memory pointer for the character string is guaranteed to be valid for the remaining life time of the process, even after all SbName instances referencing the string has been destructed. that's commitment. πŸ˜­πŸ’–

int SbName::getLength (void ) const

this method returns the number of characters in the name. πŸ“

int SbName::operator! (void ) const

this unary operator results in FALSE if the SbName object is non-empty and TRUE if the SbName object is empty. an empty name contains a null-length string. vibe check: empty = TRUE, not empty = FALSE. πŸ€”

SbName::operator const char * (void ) const

this operator returns a pointer to the character array for the name string. it is intended for implicit use.

πŸ’€ use SbName::getString() explicitly instead of this operator β€” it might be removed later. not me warning you in advance.

See also

  • const char * SbName::getString(void)

SbBool SbName::isIdentStartChar (const char c) [static]

this method checks if the c character is a valid identifier start character for a name. πŸ‘‘

See also

  • SbBool SbName::isIdentChar(const char c)

SbBool SbName::isIdentChar (const char c) [static]

this method checks if the c character is a valid character for a name.

See also

  • SbBool SbName::isIdentStartChar(const char c)

SbBool SbName::isBaseNameStartChar (const char c) [static]

returns TRUE if the given character is valid for use as the first character of a name for an object derived from a class inheriting SoBase. 🌈

SoBase derived objects needs to be named in a manner which will not clash with the special characters reserved as tokens in the syntax rules of Open Inventor and VRML files.

legal characters for the first character of an SoBase object name is underscore ("_") and any uppercase and lowercase alphabetic character from the ASCII character set (i.e. A-Z and a-z).

πŸŽ€ this method is not part of the original Open Inventor API. lowkey a Coin exclusive.

See also

  • isBaseNameChar()

SbBool SbName::isBaseNameChar (const char c) [static]

returns TRUE if the given character is valid for use in naming object instances of classes derived from SoBase. ⭐

SoBase derived objects needs to be named in a manner which will not clash with the special characters reserved as tokens in the syntax rules of Open Inventor and VRML files.

legal characters to use for an SoBase object name is any character from the ASCII character set from and including character 33 (hex 0x21) to and including 126 (hex 0x7e), except single and double apostrophes, the plus sign and punctuation, backslash and the curly braces. so like, most of ASCII but not the chaotic ones πŸ’…

πŸŽ€ this method is not part of the original Open Inventor API either. periodt.

See also

  • isBaseNameStartChar()

const SbName & SbName::empty (void ) [static]

returns an empty-string SbName instance. the void, the emptiness, the aesthetic. πŸ•³οΈβœ¨

Since

Coin 3.0


🫢 Author 🫢

generated automatically by Doxygen for Coin from the source code. not a human, just a very diligent robot. πŸ€–


and that's the whole page bestie!! this manual page is from Coin, Version 3.1.3, and it's the SbName(3) page β€” go forth and store your strings by reference (but responsibly, remember the memory thing 😭). mwah πŸ’‹

πŸ“¦ where this page comes from