Identity map.
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled
Some checks failed
CI / ubuntu-latest-html-tests (push) Has been cancelled
CI / alpine-mbedtls-3_6_0 (push) Has been cancelled
CI / ubuntu-latest-no-tls (push) Has been cancelled
CI / ubuntu-latest-mbedtls2 (push) Has been cancelled
CI / ubuntu-latest-openssl-3 (push) Has been cancelled
CI / ubuntu-latest-with-old-std (push) Has been cancelled
CI / ubuntu-20-04-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-1-1 (push) Has been cancelled
CI / macOS-13-openssl-3 (push) Has been cancelled
CI / freebsd-14-openssl-3 (push) Has been cancelled
CI / windows-mbedtls (push) Has been cancelled
This commit is contained in:
@ -55,9 +55,7 @@ void IdentifiableObject::Class::intoStringBuffer(misc::StringBuffer *sb)
|
|||||||
sb->append (">");
|
sb->append (">");
|
||||||
}
|
}
|
||||||
|
|
||||||
HashTable <ConstString, IdentifiableObject::Class>
|
std::map< std::string, std::unique_ptr< IdentifiableObject::Class > > IdentifiableObject::classesByName;
|
||||||
*IdentifiableObject::classesByName =
|
|
||||||
new HashTable<ConstString, IdentifiableObject::Class> (true, true);
|
|
||||||
|
|
||||||
std::vector< IdentifiableObject::Class * > IdentifiableObject::classesById;
|
std::vector< IdentifiableObject::Class * > IdentifiableObject::classesById;
|
||||||
|
|
||||||
@ -83,13 +81,11 @@ void IdentifiableObject::intoStringBuffer(misc::StringBuffer *sb)
|
|||||||
*/
|
*/
|
||||||
void IdentifiableObject::registerName (const char *className, int *classId)
|
void IdentifiableObject::registerName (const char *className, int *classId)
|
||||||
{
|
{
|
||||||
ConstString str (className);
|
Class *klass = classesByName.at( className ).get();
|
||||||
Class *klass = classesByName->get (&str);
|
|
||||||
if (klass == NULL) {
|
if (klass == NULL) {
|
||||||
klass = new Class (currentlyConstructedClass, classesById.size (),
|
klass = new Class (currentlyConstructedClass, classesById.size (),
|
||||||
className);
|
className);
|
||||||
ConstString *key = new ConstString (className);
|
classesByName.emplace (className, klass);
|
||||||
classesByName->put (key, klass);
|
|
||||||
classesById.push_back (klass);
|
classesById.push_back (klass);
|
||||||
*classId = klass->id;
|
*classId = klass->id;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#ifndef __LOUT_OBJECTX_HH__
|
#ifndef __LOUT_OBJECTX_HH__
|
||||||
#define __LOUT_OBJECTX_HH__
|
#define __LOUT_OBJECTX_HH__
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
#include <map>
|
||||||
|
|
||||||
#include "object.hh"
|
#include "object.hh"
|
||||||
#include "container.hh"
|
#include "container.hh"
|
||||||
#include "signal.hh"
|
#include "signal.hh"
|
||||||
@ -110,8 +114,7 @@ private:
|
|||||||
void intoStringBuffer(misc::StringBuffer *sb);
|
void intoStringBuffer(misc::StringBuffer *sb);
|
||||||
};
|
};
|
||||||
|
|
||||||
static container::typed::HashTable <object::ConstString,
|
static std::map< std::string, std::unique_ptr< Class > > classesByName;
|
||||||
Class> *classesByName;
|
|
||||||
static std::vector< Class * > classesById;
|
static std::vector< Class * > classesById;
|
||||||
static Class *currentlyConstructedClass;
|
static Class *currentlyConstructedClass;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user