mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
Add list_contents function that takes no parameters which outputs to cout thus making it callable in Python.
Format the output so it is a bit easier to read.
This commit is contained in:
parent
335d5a8ade
commit
af8a72f828
@ -157,6 +157,16 @@ list_contents(ostream &out) {
|
||||
get_ptr()->ns_list_contents(out);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ModelPool::list_contents
|
||||
// Access: Public, Static
|
||||
// Description: Lists the contents of the model pool to cout.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE void ModelPool::
|
||||
list_contents() {
|
||||
get_ptr()->ns_list_contents(cout);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ModelPool::Constructor
|
||||
// Access: Private
|
||||
|
@ -218,12 +218,16 @@ void ModelPool::
|
||||
ns_list_contents(ostream &out) const {
|
||||
MutexHolder holder(_lock);
|
||||
|
||||
out << _models.size() << " models:\n";
|
||||
out << "model pool contents:\n";
|
||||
|
||||
Models::const_iterator ti;
|
||||
for (ti = _models.begin(); ti != _models.end(); ++ti) {
|
||||
out << " " << (*ti).first
|
||||
<< " (count = " << (*ti).second->get_model_ref_count() << ")\n";
|
||||
out << (*ti).first << "\n"
|
||||
<< " (count = " << (*ti).second->get_model_ref_count()
|
||||
<< ")\n";
|
||||
}
|
||||
|
||||
out << "total number of models: " << _models.size() << "\n";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -67,6 +67,7 @@ PUBLISHED:
|
||||
INLINE static int garbage_collect();
|
||||
|
||||
INLINE static void list_contents(ostream &out);
|
||||
INLINE static void list_contents();
|
||||
static void write(ostream &out);
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user