15 #include "pandaVersion.h" 30 _systems(get_class_type())
32 _system_names_dirty =
false;
36 _package_version_string = PANDA_PACKAGE_VERSION_STR;
37 _package_host_url = PANDA_PACKAGE_HOST_URL;
39 #ifdef STDFLOAT_DOUBLE 40 add_system(
"stdfloat-double");
46 set_system_tag(
"eigen",
"vectorize",
"1");
48 set_system_tag(
"eigen",
"vectorize",
"0");
51 set_system_tag(
"eigen",
"avx",
"1");
53 set_system_tag(
"eigen",
"avx",
"0");
57 #ifdef USE_MEMORY_DLMALLOC 58 set_system_tag(
"system",
"malloc",
"dlmalloc");
59 #elif defined(USE_MEMORY_PTMALLOC2) 60 set_system_tag(
"system",
"malloc",
"ptmalloc2");
62 set_system_tag(
"system",
"malloc",
"malloc");
79 get_version_string() {
80 return PANDA_VERSION_STR;
104 return PANDA_PACKAGE_VERSION_STR;
125 return PANDA_PACKAGE_HOST_URL;
144 #ifndef P3D_COREAPI_VERSION_STR 147 return P3D_COREAPI_VERSION_STR;
157 get_major_version() {
158 return PANDA_MAJOR_VERSION;
167 get_minor_version() {
168 return PANDA_MINOR_VERSION;
177 get_sequence_version() {
178 return PANDA_SEQUENCE_VERSION;
191 is_official_version() {
192 #ifdef PANDA_OFFICIAL_VERSION 203 get_memory_alignment() {
204 return MEMORY_HOOK_ALIGNMENT;
214 return PANDA_DISTRIBUTOR;
223 #if defined(_MSC_VER) 225 std::ostringstream strm;
226 strm <<
"MSC v." << _MSC_VER;
232 strm <<
" 64 bit (Intel)";
234 strm <<
" 32 bit (Intel)";
236 #elif defined(_M_IA64) 237 strm <<
" 64 bit (Itanium)";
238 #elif defined(_M_AMD64) 239 strm <<
" 64 bit (AMD64)";
244 #elif defined(__clang__) 247 return "Clang " __clang_version__;
249 #elif defined(__GNUC__) 251 return "GCC " __VERSION__;
265 return __DATE__
" " __TIME__;
274 #ifdef PANDA_GIT_COMMIT_STR 275 return PANDA_GIT_COMMIT_STR;
288 return DTOOL_PLATFORM;
298 Systems::const_iterator si;
299 si = _systems.find(system);
300 return (si != _systems.end());
309 get_num_systems()
const {
310 return _systems.size();
319 if (n >= _systems.size()) {
323 if (_system_names_dirty) {
327 return _system_names[n];
341 Systems::const_iterator si;
342 si = _systems.find(system);
343 if (si != _systems.end()) {
345 SystemTags::const_iterator ti;
347 if (ti != tags.end()) {
360 bool inserted = _systems.insert(Systems::value_type(system,
SystemTags(get_class_type()))).second;
362 _system_names_dirty =
true;
372 const string &value) {
373 std::pair<Systems::iterator, bool> result;
374 result = _systems.insert(Systems::value_type(system,
SystemTags(get_class_type())));
376 _system_names_dirty =
true;
404 output(std::ostream &out)
const {
405 out <<
"Panda version " << get_version_string();
412 write(std::ostream &out)
const {
418 out <<
"Optional systems:\n";
419 for (Systems::const_iterator si = _systems.begin();
420 si != _systems.end();
422 out <<
" " << (*si).first <<
"\n";
423 const SystemTags &tags = (*si).second;
424 SystemTags::const_iterator ti;
425 for (ti = tags.begin(); ti != tags.end(); ++ti) {
426 out <<
" " << (*ti).first <<
" " << (*ti).second <<
"\n";
437 if (_global_ptr ==
nullptr) {
450 reset_system_names() {
451 _system_names.clear();
452 _system_names.reserve(_systems.size());
454 Systems::const_iterator si;
455 for (si = _systems.begin(); si != _systems.end(); ++si) {
456 _system_names.push_back((*si).first);
459 _system_names_dirty =
false;
470 set_package_version_string(
const string &package_version_string) {
471 _package_version_string = PANDA_PACKAGE_VERSION_STR;
472 if (_package_version_string.empty()) {
473 _package_version_string = package_version_string;
485 set_package_host_url(
const string &package_host_url) {
486 _package_host_url = PANDA_PACKAGE_HOST_URL;
487 if (_package_host_url.empty()) {
488 _package_host_url = package_host_url;
static PandaSystem * get_global_ptr()
Returns the global PandaSystem object.
This class is used as a namespace to group several global properties of Panda.
get_build_date
Returns a string representing the date and time at which this version of Panda (or at least dtool) wa...
static std::string get_p3d_coreapi_version_string()
Returns the current version of Panda's Core API, expressed as a string of dot-delimited integers.
static std::string get_package_version_string()
Returns the version of the Panda3D distributable package that provides this build of Panda.
std::string get_system_tag(const std::string &system, const std::string &tag) const
Returns the value associated with the indicated tag for the given system.
get_compiler
Returns a string representing the compiler that was used to generate this version of Panda,...
bool heap_trim(size_t pad)
Attempts to release memory back to the system, if possible.
get_system
Returns the nth Panda subsystem that has registered itself.
bool has_system(const std::string &system) const
Returns true if the current version of Panda claims to have the indicated subsystem installed,...
void add_system(const std::string &system)
Intended for use by each subsystem to register itself at startup.
void set_system_tag(const std::string &system, const std::string &tag, const std::string &value)
Intended for use by each subsystem to register its set of capabilities at startup.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
get_distributor
Returns the string defined by the distributor of this version of Panda, or "homebuilt" if this versio...
bool heap_trim(size_t pad)
Attempts to release memory back to the system, if possible.
static std::string get_package_host_url()
Returns the URL of the download server that provides the Panda3D distributable package currently runn...