sc::TranslateData(3)

πŸ“¦
version 2.3.1 Β· 5 versions
, in ubuntu jammy

okay so bestie, welcome to sc::TranslateData(3) from the MPQC manual. it’s giving generic data translation with a whole buffet of overloads, so grab a strawberry πŸ“ and let’s get into it.

🌸 NAME 🌸

sc::TranslateData β€” Generic data translation.

✨ SYNOPSIS ✨

first, include the header, no cap:

#include <translate.h>
Inherited by sc::TranslateDataByteSwap.

πŸ’… Public Member Functions πŸ’…

here’s the full public-member-function lineup, copied exactly so no signature gets lost in the group chat:

virtual char format_code ()
virtual void to_native (char *, int n)
virtual void to_external (char *, int n)
virtual void to_native (short *, int n)
virtual void to_external (short *, int n)
virtual void to_native (unsigned int *, int n)
virtual void to_external (unsigned int *, int n)
virtual void to_native (int *, int n)
virtual void to_external (int *, int n)
virtual void to_native (long *, int n)
virtual void to_external (long *, int n)
virtual void to_native (float *, int n)
virtual void to_external (float *, int n)
virtual void to_native (double *, int n)
virtual void to_external (double *, int n)
virtual void to_native (char *target, const void *source, int n)
virtual void to_external (void *target, const char *source, int n)
virtual void to_native (short *, const void *, int n)
virtual void to_external (void *, const short *, int n)
virtual void to_native (unsigned int *, const void *, int n)
virtual void to_external (void *, const unsigned int *, int n)
virtual void to_native (int *, const void *, int n)
virtual void to_external (void *, const int *, int n)
virtual void to_native (long *, const void *, int n)
virtual void to_external (void *, const long *, int n)
virtual void to_native (float *, const void *, int n)
virtual void to_external (void *, const float *, int n)
virtual void to_native (double *, const void *, int n)
virtual void to_external (void *, const double *, int n)
lowkey important: the source only gives extra one-line descriptions for a few of these. for the rest, it’s just the signature β€” so I’m not inventing behavior, okay? 🫢

the ones with extra prose in the source:

  • virtual char format_code () β€” hands you back a code for the type of format used for the external data. very format-code, very demure ✨
  • virtual void to_native (char *, int n) β€” translates to native format in-place. yes bestie, in-place πŸ’…
  • virtual void to_external (char *, int n) β€” translates to external format in-place. same in-place energy, opposite direction πŸ¦‹
  • virtual void to_native (char *target, const void *source, int n) β€” translates to native format. target and source are right there in the signature, iconic πŸŽ€
  • virtual void to_external (void *target, const char *source, int n) β€” translates to external format. again: target, source, n, we love a complete set 🌸

πŸŽ€ Static Public Member Functions πŸŽ€

  • static TranslateData * vctor (char code) β€” a virtual constructor that chooses a specialization based on the format code. it’s giving β€œpick your fighter” but for formats πŸ‘‘

πŸ’– Detailed Description πŸ’–

Generic data translation.

that’s the whole vibe. this class is literally about generic data translation, and the page is not gonna pretend otherwise πŸ’œ

πŸ’… Member Function Documentation πŸ’…

the source repeats these four with [virtual] and a note about reimplementation. here they are, exact signatures and all:

virtual void sc::TranslateData::to_external (char *, int n) [virtual]

Translates to external format in-place. Similar routines exist for all the basic types.

Reimplemented in sc::TranslateDataByteSwap.

virtual void sc::TranslateData::to_external (void * target, const char * source, int n) [virtual]

Translates to external format. Similar routines exist for all the basic types.

Reimplemented in sc::TranslateDataByteSwap.

virtual void sc::TranslateData::to_native (char *, int n) [virtual]

Translates to native format in-place. Similar routines exist for all the basic types.

Reimplemented in sc::TranslateDataByteSwap.

virtual void sc::TranslateData::to_native (char * target, const void * source, int n) [virtual]

Translates to native format. Similar routines exist for all the basic types.

Reimplemented in sc::TranslateDataByteSwap.

🫢 Author 🫢

Generated automatically by Doxygen for MPQC from the source code. yes, the robots wrote it β€” we’re just making it cute 😌


and that’s the whole page, bestie. this was sc::TranslateData(3) from MPQC, version 2.3.1, dated Sun Oct 4 2020. mwah πŸ’‹

πŸ“¦ where this page comes from