* ./hurricane/src/viewer:
- Change: In Cyclop, now uses the GtkStyle when not under OSX and Qt is newer or equal to Qt 4.5.0. - Change: In the various Qt Model Table, do the rowHeigh bug correction. - Bug: In InspectorWidget/NetlistModel, when browsing through the records tree, the records were generated twice at each slot change. This was due to the History ComboBox sending a index change signal then the InspectorWidget setting the slot *again*. When trying to explore a Slot, but this Slot is empty (like an empty vector, for instance) do not gut the RecordModel. Because as we find out that the new Slot is empty we go back and restore the previous contents. Potentially slow if we comes from a Slot with lots of records. Now we dump the contents only if there is something to explore. * ./hurricane/src/hurricane: - Bug: In Record, the slots where stored in a list container, which was making indexed accesses very very slow. This slowdown was also affecting the destructor of Record (this is the explanation why the RecordWidget was slow, even when *leaving* the net IntrusiveSet). Now implemented in term of STL vector. - Bug: In Slot/Common, still some adjustements to make the Inspection mechanism work with all types. Correct the "IntrusiveMap<>" not working with the NetMap. Related to templates not using the same constness. - Change: In Entity/DBo/Cell, Some more adjustements on Slot/Records.
This commit is contained in:
parent
3f10d44549
commit
53ba314063
|
@ -1,5 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane )
|
include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane )
|
||||||
set ( includes hurricane/Mask.h
|
set ( includes hurricane/Mask.h
|
||||||
hurricane/DebugSession.h
|
hurricane/DebugSession.h
|
||||||
|
@ -151,7 +150,6 @@
|
||||||
Timer.cpp
|
Timer.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library ( hurricane ${cpps} )
|
add_library ( hurricane ${cpps} )
|
||||||
install ( TARGETS hurricane DESTINATION /lib)
|
install ( TARGETS hurricane DESTINATION /lib)
|
||||||
|
install ( FILES ${includes} DESTINATION /include/hurricane )
|
||||||
install(FILES ${includes} DESTINATION /include/hurricane)
|
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// not, see <http://www.gnu.org/licenses/>.
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
|
//#define TEST_INTRUSIVESET
|
||||||
|
|
||||||
#include "hurricane/Cell.h"
|
#include "hurricane/Cell.h"
|
||||||
#include "hurricane/DataBase.h"
|
#include "hurricane/DataBase.h"
|
||||||
#include "hurricane/Library.h"
|
#include "hurricane/Library.h"
|
||||||
|
@ -369,7 +371,7 @@ void Cell::_removeSlaveEntity(Entity* entity, Entity* slaveEntity)
|
||||||
|
|
||||||
pair<SlaveEntityMap::iterator,SlaveEntityMap::iterator>
|
pair<SlaveEntityMap::iterator,SlaveEntityMap::iterator>
|
||||||
bounds = _slaveEntityMap.equal_range(entity);
|
bounds = _slaveEntityMap.equal_range(entity);
|
||||||
multimap<Entity*,Entity*>::iterator it = bounds.first;
|
SlaveEntityMap::iterator it = bounds.first;
|
||||||
for(; it != bounds.second ; it++ ) {
|
for(; it != bounds.second ; it++ ) {
|
||||||
if (it->second == slaveEntity) {
|
if (it->second == slaveEntity) {
|
||||||
_slaveEntityMap.erase(it);
|
_slaveEntityMap.erase(it);
|
||||||
|
|
|
@ -17,12 +17,9 @@
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// not, see <http://www.gnu.org/licenses/>.
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
#ifdef HAVE_LIBIBERTY
|
|
||||||
#include "hurricane/demangle.h"
|
|
||||||
#include "hurricane/libiberty.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include <cxxabi.h>
|
||||||
|
#include "hurricane/Commons.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
@ -100,26 +97,31 @@ void ltraceout (unsigned int level, unsigned int count )
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Function : "Demangle ()".
|
// Function : "demangle ()".
|
||||||
|
|
||||||
|
|
||||||
|
#define HAVE_CXA_DEMANGLE
|
||||||
|
|
||||||
|
#ifdef HAVE_CXA_DEMANGLE
|
||||||
|
|
||||||
string demangle ( const char* symbol )
|
string demangle ( const char* symbol )
|
||||||
{
|
{
|
||||||
string mangled = "_Z";
|
int status;
|
||||||
mangled += symbol;
|
unsigned int length = 4096;
|
||||||
|
char demangled[length];
|
||||||
# ifdef HAVE_LIBIBERTY
|
|
||||||
char* result = cplus_demangle ( mangled.c_str(), DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES );
|
|
||||||
|
|
||||||
if ( result ) {
|
abi::__cxa_demangle ( symbol, demangled, &length, &status );
|
||||||
mangled = result;
|
return demangled;
|
||||||
free ( result );
|
|
||||||
return mangled;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
return mangled;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
string demangle ( const char* symbol )
|
||||||
|
{
|
||||||
|
return symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
#include "hurricane/DBo.h"
|
|
||||||
#include "hurricane/Property.h"
|
#include "hurricane/Property.h"
|
||||||
|
#include "hurricane/DBo.h"
|
||||||
#include "hurricane/Quark.h"
|
#include "hurricane/Quark.h"
|
||||||
#include "hurricane/Error.h"
|
#include "hurricane/Error.h"
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
Property* DBo::getProperty ( const Name& name ) const
|
Property* DBo::getProperty ( const Name& name ) const
|
||||||
{
|
{
|
||||||
PropertySet::const_iterator iterator = _propertySet.begin();
|
set<Property*>::const_iterator iterator = _propertySet.begin();
|
||||||
while ( iterator != _propertySet.end() ) {
|
while ( iterator != _propertySet.end() ) {
|
||||||
Property* property = *iterator;
|
Property* property = *iterator;
|
||||||
if (property->getName() == name) return property;
|
if (property->getName() == name) return property;
|
||||||
|
@ -173,7 +173,7 @@ namespace Hurricane {
|
||||||
Record* DBo::_getRecord () const
|
Record* DBo::_getRecord () const
|
||||||
{
|
{
|
||||||
Record* record = new Record ( getString(this) );
|
Record* record = new Record ( getString(this) );
|
||||||
record->add ( getSlot("Properties", &_propertySet) );
|
record->add ( getSlot("_propertySet", &_propertySet) );
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,15 @@
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
|
|
||||||
#include "hurricane/DRCError.h"
|
#include "hurricane/DRCError.h"
|
||||||
#include "hurricane/Cell.h"
|
//#include "hurricane/Cell.h"
|
||||||
#include "hurricane/Slice.h"
|
#include "hurricane/Slice.h"
|
||||||
#include "hurricane/Error.h"
|
#include "hurricane/Error.h"
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
class Cell;
|
||||||
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
// ****************************************************************************************************
|
||||||
// DRCError implementation
|
// DRCError implementation
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
#include "hurricane/DataBase.h"
|
#include "hurricane/DataBase.h"
|
||||||
#include "hurricane/Technology.h"
|
#include "hurricane/Technology.h"
|
||||||
#include "hurricane/Library.h"
|
#include "hurricane/Library.h"
|
||||||
#include "hurricane/Cell.h"
|
|
||||||
#include "hurricane/Timer.h"
|
|
||||||
#include "hurricane/Error.h"
|
#include "hurricane/Error.h"
|
||||||
#include "hurricane/UpdateSession.h"
|
#include "hurricane/UpdateSession.h"
|
||||||
|
|
||||||
|
@ -87,10 +85,10 @@ Record* DataBase::_getRecord() const
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_getRecord();
|
Record* record = Inherit::_getRecord();
|
||||||
if (record) {
|
if (record) {
|
||||||
record->add(getSlot("Technology", _technology));
|
record->add(getSlot("_technology" , _technology ));
|
||||||
record->add(getSlot("RootLibrary", _rootLibrary));
|
record->add(getSlot("_rootLibrary" , _rootLibrary ));
|
||||||
record->add(getSlot("Precision", DbU::getPrecision()));
|
record->add(getSlot("DbU::precision" , DbU::getPrecision()));
|
||||||
record->add(getSlot("Resolution", DbU::db(1)));
|
record->add(getSlot("DbU::resolution", DbU::db(1) ));
|
||||||
//record->add(getSlot("GridStep", getValueString(getGridStep())));
|
//record->add(getSlot("GridStep", getValueString(getGridStep())));
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
|
|
|
@ -47,8 +47,6 @@
|
||||||
#include "hurricane/DebugSession.h"
|
#include "hurricane/DebugSession.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
Record::Record ( const string& name )
|
Record::Record ( const string& name )
|
||||||
: _name(name)
|
: _name (name)
|
||||||
, _slotList()
|
, _slots()
|
||||||
{
|
{
|
||||||
_allocateds++;
|
_allocateds++;
|
||||||
}
|
}
|
||||||
|
@ -62,11 +62,9 @@ namespace Hurricane {
|
||||||
Record::~Record ()
|
Record::~Record ()
|
||||||
{
|
{
|
||||||
//cerr << "Record::~Record() - " << _name << ": " << hex << (void*)this << dec << endl;
|
//cerr << "Record::~Record() - " << _name << ": " << hex << (void*)this << dec << endl;
|
||||||
while (!_slotList.empty()) {
|
for ( size_t i=0 ; i<_slots.size() ; i++ )
|
||||||
Slot* slot = *_slotList.begin();
|
delete _slots[i];
|
||||||
_slotList.remove(slot);
|
|
||||||
delete slot;
|
|
||||||
}
|
|
||||||
_allocateds--;
|
_allocateds--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,9 +77,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
Slot* Record::getSlot ( unsigned no ) const
|
Slot* Record::getSlot ( unsigned no ) const
|
||||||
{
|
{
|
||||||
SlotList::const_iterator iterator = _slotList.begin();
|
if ( no >= _slots.size() ) return NULL;
|
||||||
while (no-- && (iterator != _slotList.end())) ++iterator;
|
return _slots[no];
|
||||||
return (iterator == _slotList.end()) ? NULL : *iterator;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -91,7 +88,7 @@ namespace Hurricane {
|
||||||
cerr << "[ERROR] Record::add(): Attempt to add NULL Slot." << endl;
|
cerr << "[ERROR] Record::add(): Attempt to add NULL Slot." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_slotList.push_back(slot);
|
_slots.push_back(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
#include "hurricane/Pathes.h"
|
#include "hurricane/Pathes.h"
|
||||||
#include "hurricane/Entity.h"
|
#include "hurricane/Entity.h"
|
||||||
#include "hurricane/Cells.h"
|
#include "hurricane/Cells.h"
|
||||||
#include "hurricane/Instance.h"
|
|
||||||
#include "hurricane/DeepNet.h"
|
#include "hurricane/DeepNet.h"
|
||||||
|
#include "hurricane/Instance.h"
|
||||||
#include "hurricane/Pin.h"
|
#include "hurricane/Pin.h"
|
||||||
#include "hurricane/Pins.h"
|
#include "hurricane/Pins.h"
|
||||||
#include "hurricane/Slices.h"
|
#include "hurricane/Slices.h"
|
||||||
|
@ -38,11 +38,12 @@
|
||||||
#include "hurricane/Transformation.h"
|
#include "hurricane/Transformation.h"
|
||||||
#include "hurricane/Layer.h"
|
#include "hurricane/Layer.h"
|
||||||
#include "hurricane/QuadTree.h"
|
#include "hurricane/QuadTree.h"
|
||||||
#include "hurricane/IntrusiveMap.h"
|
//#include "hurricane/IntrusiveMap.h"
|
||||||
#include "hurricane/IntrusiveSet.h"
|
#include "hurricane/IntrusiveSet.h"
|
||||||
#include "hurricane/MapCollection.h"
|
#include "hurricane/MapCollection.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
class Library;
|
class Library;
|
||||||
|
@ -168,7 +169,7 @@ class Cell : public Entity {
|
||||||
private: bool _isPad;
|
private: bool _isPad;
|
||||||
private: Cell* _nextOfLibraryCellMap;
|
private: Cell* _nextOfLibraryCellMap;
|
||||||
private: Cell* _nextOfSymbolCellSet;
|
private: Cell* _nextOfSymbolCellSet;
|
||||||
private: multimap<Entity*,Entity*> _slaveEntityMap;
|
private: SlaveEntityMap _slaveEntityMap;
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
// ************
|
// ************
|
||||||
|
|
|
@ -182,9 +182,10 @@ namespace Hurricane {
|
||||||
|
|
||||||
// Forward declaration of "getSlot<>()" template.
|
// Forward declaration of "getSlot<>()" template.
|
||||||
|
|
||||||
template<typename Data> inline Hurricane::Slot* getSlot ( std::string& name, Data d );
|
template<typename Data> inline Hurricane::Slot* getSlot ( std::string& name, Data );
|
||||||
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data d );
|
template<typename Data> inline Hurricane::Slot* getSlot ( std::string& name, Data* );
|
||||||
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data* d );
|
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data );
|
||||||
|
template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& name, Data* );
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
@ -193,7 +194,9 @@ template<typename Data> inline Hurricane::Slot* getSlot ( const std::string& nam
|
||||||
// Default match.
|
// Default match.
|
||||||
|
|
||||||
template<typename Data> inline std::string getString ( Data data )
|
template<typename Data> inline std::string getString ( Data data )
|
||||||
{ return "<Data type unsupported by getString()>"; }
|
{ return std::string("<type ")
|
||||||
|
+ Hurricane::demangle(typeid(data).name())
|
||||||
|
+ std::string(" unsupported by getString()>"); }
|
||||||
|
|
||||||
// "const *" flavors.
|
// "const *" flavors.
|
||||||
|
|
||||||
|
@ -278,7 +281,7 @@ template<> inline std::string getString<std::string*> ( std::string* s )
|
||||||
template<> inline std::string getString<bool> ( bool b )
|
template<> inline std::string getString<bool> ( bool b )
|
||||||
{ return (b)?"True":"False" ; }
|
{ return (b)?"True":"False" ; }
|
||||||
|
|
||||||
template<> inline std::string getString<char> ( const char c )
|
template<> inline std::string getString<char> ( char c )
|
||||||
{ return std::string(1,c); }
|
{ return std::string(1,c); }
|
||||||
|
|
||||||
template<> inline std::string getString<int> ( int i )
|
template<> inline std::string getString<int> ( int i )
|
||||||
|
@ -314,7 +317,32 @@ template<typename Data> inline Hurricane::Record* getRecord ( Data data )
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Inspector Support for : "const std::vector<Element>*".
|
// Inspector Support for : "[const] std::vector<Element>*".
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Element>
|
||||||
|
inline std::string getString ( std::vector<Element>* v )
|
||||||
|
{
|
||||||
|
std::string name = "const std::vector<Element>:";
|
||||||
|
return name + getString<size_t>(v->size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Element>
|
||||||
|
inline Hurricane::Record* getRecord ( std::vector<Element>* v )
|
||||||
|
{
|
||||||
|
Hurricane::Record* record = NULL;
|
||||||
|
if ( !v->empty() ) {
|
||||||
|
record = new Hurricane::Record ( "std::vector<Element>" );
|
||||||
|
unsigned n = 1;
|
||||||
|
typename std::vector<Element>::iterator iterator = v->begin();
|
||||||
|
while ( iterator != v->end() ) {
|
||||||
|
record->add ( getSlot<Element>(getString(n++), *iterator) );
|
||||||
|
++iterator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename Element>
|
template<typename Element>
|
||||||
|
@ -334,7 +362,7 @@ inline Hurricane::Record* getRecord ( const std::vector<Element>* v )
|
||||||
unsigned n = 1;
|
unsigned n = 1;
|
||||||
typename std::vector<Element>::const_iterator iterator = v->begin();
|
typename std::vector<Element>::const_iterator iterator = v->begin();
|
||||||
while ( iterator != v->end() ) {
|
while ( iterator != v->end() ) {
|
||||||
record->add ( getSlot<Element>(getString(n++), *iterator) );
|
record->add ( getSlot<const Element>(getString(n++), *iterator) );
|
||||||
++iterator;
|
++iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,7 +391,7 @@ inline Hurricane::Record* getRecord ( const std::list<Element>* l )
|
||||||
unsigned n = 1;
|
unsigned n = 1;
|
||||||
typename std::list<Element>::const_iterator iterator = l->begin();
|
typename std::list<Element>::const_iterator iterator = l->begin();
|
||||||
while ( iterator != l->end() ) {
|
while ( iterator != l->end() ) {
|
||||||
record->add ( getSlot<Element>(getString(n++), *iterator) );
|
record->add ( getSlot<const Element>(getString(n++), *iterator) );
|
||||||
++iterator;
|
++iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -401,7 +429,7 @@ inline Hurricane::Record* getRecord ( std::list<Element>* l )
|
||||||
|
|
||||||
|
|
||||||
template<typename Key, typename Element, typename Compare>
|
template<typename Key, typename Element, typename Compare>
|
||||||
inline std::string getString ( const std::map<Key,Element,Compare>* m )
|
inline std::string getString ( std::map<Key,Element,Compare>* m )
|
||||||
{
|
{
|
||||||
std::string name = "std::map<Element>:";
|
std::string name = "std::map<Element>:";
|
||||||
return name + getString<size_t>(m->size());
|
return name + getString<size_t>(m->size());
|
||||||
|
@ -409,12 +437,12 @@ inline std::string getString ( const std::map<Key,Element,Compare>* m )
|
||||||
|
|
||||||
|
|
||||||
template<typename Key, typename Element, typename Compare>
|
template<typename Key, typename Element, typename Compare>
|
||||||
inline Hurricane::Record* getRecord ( const std::map<Key,Element,Compare>* m )
|
inline Hurricane::Record* getRecord ( std::map<Key,Element,Compare>* m )
|
||||||
{
|
{
|
||||||
Hurricane::Record* record = NULL;
|
Hurricane::Record* record = NULL;
|
||||||
if ( !m->empty() ) {
|
if ( !m->empty() ) {
|
||||||
record = new Hurricane::Record ( "std::map<Element>" );
|
record = new Hurricane::Record ( "std::map<Element>" );
|
||||||
typename std::map<Key,Element,Compare>::const_iterator iterator = m->begin();
|
typename std::map<Key,Element,Compare>::iterator iterator = m->begin();
|
||||||
while ( iterator != m->end() ) {
|
while ( iterator != m->end() ) {
|
||||||
record->add ( getSlot<Element>(getString(iterator->first), iterator->second) );
|
record->add ( getSlot<Element>(getString(iterator->first), iterator->second) );
|
||||||
++iterator;
|
++iterator;
|
||||||
|
@ -424,14 +452,38 @@ inline Hurricane::Record* getRecord ( const std::map<Key,Element,Compare>* m )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Key, typename Element, typename Compare>
|
||||||
|
inline std::string getString ( const std::map<Key,Element,Compare>* m )
|
||||||
|
{
|
||||||
|
std::string name = "const std::map<Element>:";
|
||||||
|
return name + getString<size_t>(m->size());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Key, typename Element, typename Compare>
|
||||||
|
inline Hurricane::Record* getRecord ( const std::map<Key,Element,Compare>* m )
|
||||||
|
{
|
||||||
|
Hurricane::Record* record = NULL;
|
||||||
|
if ( !m->empty() ) {
|
||||||
|
record = new Hurricane::Record ( "const std::map<Element>" );
|
||||||
|
typename std::map<Key,Element,Compare>::const_iterator iterator = m->begin();
|
||||||
|
while ( iterator != m->end() ) {
|
||||||
|
record->add ( getSlot<const Element>(getString(iterator->first), iterator->second) );
|
||||||
|
++iterator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return record;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Inspector Support for : "[const] std::multimap<Key,Element,Compare>*.
|
// Inspector Support for : "const std::multimap<Key,Element,Compare>*".
|
||||||
|
|
||||||
|
|
||||||
template<typename Key, typename Element, typename Compare>
|
template<typename Key, typename Element, typename Compare>
|
||||||
inline std::string getString ( const std::multimap<Key,Element,Compare>* m )
|
inline std::string getString ( const std::multimap<Key,Element,Compare>* m )
|
||||||
{
|
{
|
||||||
std::string name = "std::multimap<Element>:";
|
std::string name = "const std::multimap<Element>:";
|
||||||
return name + getString<size_t>(m->size());
|
return name + getString<size_t>(m->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -441,10 +493,10 @@ inline Hurricane::Record* getRecord ( const std::multimap<Key,Element,Compare>*
|
||||||
{
|
{
|
||||||
Hurricane::Record* record = NULL;
|
Hurricane::Record* record = NULL;
|
||||||
if ( !m->empty() ) {
|
if ( !m->empty() ) {
|
||||||
record = new Hurricane::Record ( "std::multimap<Element>" );
|
record = new Hurricane::Record ( "const std::multimap<Element>" );
|
||||||
typename std::multimap<Key,Element,Compare>::const_iterator iterator = m->begin();
|
typename std::multimap<Key,Element,Compare>::const_iterator iterator = m->begin();
|
||||||
while ( iterator != m->end() ) {
|
while ( iterator != m->end() ) {
|
||||||
record->add ( getSlot<Element>(getString(iterator->first), iterator->second) );
|
record->add ( getSlot<const Element>(getString(iterator->first), iterator->second) );
|
||||||
++iterator;
|
++iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -497,32 +549,30 @@ inline Hurricane::Record* getRecord ( const std::set<Element,Compare>* s )
|
||||||
unsigned n = 1;
|
unsigned n = 1;
|
||||||
typename std::set<Element,Compare>::const_iterator iterator = s->begin();
|
typename std::set<Element,Compare>::const_iterator iterator = s->begin();
|
||||||
while ( iterator != s->end() ) {
|
while ( iterator != s->end() ) {
|
||||||
record->add ( getSlot<Element>(getString(n++), *iterator) );
|
record->add ( getSlot<const Element>(getString(n++), *iterator) );
|
||||||
++iterator;
|
++iterator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
|
||||||
// Inspector Support for : "std::set<Element,Compare>*".
|
|
||||||
|
|
||||||
template<typename Element, typename Compare>
|
template< typename Element, typename Compare, typename Allocator >
|
||||||
inline std::string getString ( std::set<Element,Compare>* s )
|
inline std::string getString ( std::set<Element,Compare,Allocator>* s )
|
||||||
{
|
{
|
||||||
std::string name = "std::set<Element>:";
|
std::string name = "std::set<Element>:";
|
||||||
return name + getString<size_t>(s->size());
|
return name + getString<size_t>(s->size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename Element, typename Compare>
|
template< typename Element, typename Compare, typename Allocator >
|
||||||
inline Hurricane::Record* getRecord ( std::set<Element,Compare>* s )
|
inline Hurricane::Record* getRecord ( std::set<Element,Compare,Allocator>* s )
|
||||||
{
|
{
|
||||||
Hurricane::Record* record = NULL;
|
Hurricane::Record* record = NULL;
|
||||||
if ( !s->empty() ) {
|
if ( !s->empty() ) {
|
||||||
record = new Hurricane::Record ( "std::set<Element>" );
|
record = new Hurricane::Record ( "std::set<Element>" );
|
||||||
unsigned n = 1;
|
unsigned n = 1;
|
||||||
typename std::set<Element,Compare>::iterator iterator = s->begin();
|
typename std::set<Element,Compare,Allocator>::iterator iterator = s->begin();
|
||||||
while ( iterator != s->end() ) {
|
while ( iterator != s->end() ) {
|
||||||
record->add ( getSlot<Element>(getString(n++), *iterator) );
|
record->add ( getSlot<Element>(getString(n++), *iterator) );
|
||||||
++iterator;
|
++iterator;
|
||||||
|
|
|
@ -42,16 +42,13 @@
|
||||||
#define __HURRICANE_DBO__
|
#define __HURRICANE_DBO__
|
||||||
|
|
||||||
#include "hurricane/DBos.h"
|
#include "hurricane/DBos.h"
|
||||||
#include "hurricane/Properties.h"
|
|
||||||
#include "hurricane/Name.h"
|
#include "hurricane/Name.h"
|
||||||
|
#include "hurricane/Properties.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
class Property;
|
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "Hurricane::DBo".
|
// Class : "Hurricane::DBo".
|
||||||
|
|
||||||
|
@ -59,27 +56,25 @@ namespace Hurricane {
|
||||||
class DBo {
|
class DBo {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Types.
|
|
||||||
typedef set<Property*> PropertySet;
|
|
||||||
// Methods.
|
// Methods.
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
inline PropertySet& _getPropertySet ();
|
inline set<Property*>& _getPropertySet ();
|
||||||
void _onDestroyed ( Property* property );
|
void _onDestroyed ( Property* property );
|
||||||
Property* getProperty ( const Name& ) const;
|
Property* getProperty ( const Name& ) const;
|
||||||
Properties getProperties () const;
|
Properties getProperties () const;
|
||||||
inline bool hasProperty () const;
|
inline bool hasProperty () const;
|
||||||
void put ( Property* );
|
void put ( Property* );
|
||||||
void remove ( Property* );
|
void remove ( Property* );
|
||||||
void removeProperty ( const Name& );
|
void removeProperty ( const Name& );
|
||||||
void clearProperties ();
|
void clearProperties ();
|
||||||
// Hurricane Managment.
|
// Hurricane Managment.
|
||||||
virtual string _getTypeName () const;
|
virtual string _getTypeName () const;
|
||||||
virtual string _getString () const;
|
virtual string _getString () const;
|
||||||
virtual Record* _getRecord () const;
|
virtual Record* _getRecord () const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Internal: Attributes.
|
// Internal: Attributes.
|
||||||
mutable PropertySet _propertySet;
|
mutable set<Property*> _propertySet;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Internal: Constructors & Destructors.
|
// Internal: Constructors & Destructors.
|
||||||
|
@ -95,8 +90,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
// Inline Functions.
|
// Inline Functions.
|
||||||
inline DBo::PropertySet& DBo::_getPropertySet () { return _propertySet; }
|
inline set<Property*>& DBo::_getPropertySet () { return _propertySet; }
|
||||||
inline bool DBo::hasProperty () const { return !_propertySet.empty(); }
|
inline bool DBo::hasProperty () const { return !_propertySet.empty(); }
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
@ -105,18 +100,4 @@ namespace Hurricane {
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::DBo);
|
INSPECTOR_P_SUPPORT(Hurricane::DBo);
|
||||||
|
|
||||||
|
|
||||||
template<>
|
|
||||||
inline Hurricane::Slot* getSlot ( const std::string& name, const std::set<Hurricane::Property*>* s )
|
|
||||||
{
|
|
||||||
return new Hurricane::SlotTemplate<const std::set<Hurricane::Property*>*>(name,s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<>
|
|
||||||
inline Hurricane::Slot* getSlot ( const std::string& name, std::set<Hurricane::Property*>* s )
|
|
||||||
{
|
|
||||||
return new Hurricane::SlotTemplate<std::set<Hurricane::Property*>*>(name,s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __HURRICANE_DBO__
|
#endif // __HURRICANE_DBO__
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include "hurricane/Go.h"
|
#include "hurricane/Go.h"
|
||||||
#include "hurricane/Plug.h"
|
#include "hurricane/Plug.h"
|
||||||
#include "hurricane/SharedPath.h"
|
#include "hurricane/SharedPath.h"
|
||||||
#include "hurricane/IntrusiveMap.h"
|
//#include "hurricane/IntrusiveMap.h"
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
|
@ -342,7 +342,7 @@ template<class Key, class Element> class IntrusiveMap {
|
||||||
n = 1;
|
n = 1;
|
||||||
Element* element = _array[index];
|
Element* element = _array[index];
|
||||||
while (element) {
|
while (element) {
|
||||||
record->add(getSlot(getString(index) + ":" + getString(n++), element));
|
record->add(getSlot<Element*>(getString(index) + ":" + getString(n++), element));
|
||||||
element = _getNextElement(element);
|
element = _getNextElement(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,25 +57,25 @@ namespace Hurricane {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Types.
|
// Types.
|
||||||
typedef list<Slot*> SlotList;
|
typedef vector<Slot*> SlotVector;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor & Destructor.
|
// Constructor & Destructor.
|
||||||
Record ( const string& name );
|
Record ( const string& name );
|
||||||
virtual ~Record ();
|
virtual ~Record ();
|
||||||
// Methods.
|
// Methods.
|
||||||
static size_t getAllocateds ();
|
static size_t getAllocateds ();
|
||||||
inline const string& getName () const;
|
inline const string& getName () const;
|
||||||
Slot* getSlot ( unsigned no ) const;
|
Slot* getSlot ( unsigned no ) const;
|
||||||
void add ( Slot* slot );
|
void add ( Slot* slot );
|
||||||
inline SlotList& _getSlotList ();
|
inline SlotVector& _getSlotVector ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Internal: Static Attributes.
|
// Internal: Static Attributes.
|
||||||
static size_t _allocateds;
|
static size_t _allocateds;
|
||||||
// Internal: Attributes
|
// Internal: Attributes
|
||||||
string _name;
|
string _name;
|
||||||
SlotList _slotList;
|
SlotVector _slots;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Forbidden: Constructors
|
// Forbidden: Constructors
|
||||||
|
@ -85,8 +85,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
// Inline Functions.
|
// Inline Functions.
|
||||||
inline const string& Record::getName () const { return _name; }
|
inline const string& Record::getName () const { return _name; }
|
||||||
inline Record::SlotList& Record::_getSlotList () { return _slotList; }
|
inline Record::SlotVector& Record::_getSlotVector () { return _slots; }
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -91,11 +91,58 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "SlotTemplate".
|
// Class : "SlotTemplate<Data>".
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
class SlotTemplate : public Slot {
|
class SlotTemplate : public Slot {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Constructor.
|
||||||
|
SlotTemplate ( const string& name, Data data );
|
||||||
|
SlotTemplate ( string& name, Data data );
|
||||||
|
// Accessors.
|
||||||
|
virtual string getDataString () const;
|
||||||
|
virtual Record* getDataRecord () const;
|
||||||
|
virtual SlotTemplate<Data>*
|
||||||
|
getClone () const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Internal: Attributes.
|
||||||
|
Data _data;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Internal: Constructors.
|
||||||
|
SlotTemplate ( const SlotTemplate& );
|
||||||
|
SlotTemplate& operator= ( const SlotTemplate& );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Inline Member Functions.
|
||||||
|
template<typename Data>
|
||||||
|
SlotTemplate<Data>::SlotTemplate ( const string& name, Data data )
|
||||||
|
: Slot(name), _data(data) { }
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
SlotTemplate<Data>::SlotTemplate ( string& name, Data data )
|
||||||
|
: Slot(name), _data(data) { }
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
string SlotTemplate<Data>::getDataString () const { return ::getString(_data); }
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
Record* SlotTemplate<Data>::getDataRecord () const { return ::getRecord(_data); }
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
SlotTemplate<Data>* SlotTemplate<Data>::getClone () const
|
||||||
|
{ return new SlotTemplate(_name,_data); }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "SlotTemplate<const Data>".
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
class SlotTemplate<const Data> : public Slot {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor.
|
// Constructor.
|
||||||
SlotTemplate ( const string& name, const Data data );
|
SlotTemplate ( const string& name, const Data data );
|
||||||
|
@ -103,7 +150,7 @@ namespace Hurricane {
|
||||||
// Accessors.
|
// Accessors.
|
||||||
virtual string getDataString () const;
|
virtual string getDataString () const;
|
||||||
virtual Record* getDataRecord () const;
|
virtual Record* getDataRecord () const;
|
||||||
virtual SlotTemplate<Data>*
|
virtual SlotTemplate<const Data>*
|
||||||
getClone () const;
|
getClone () const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -119,21 +166,21 @@ namespace Hurricane {
|
||||||
|
|
||||||
// Inline Member Functions.
|
// Inline Member Functions.
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
SlotTemplate<Data>::SlotTemplate ( const string& name, const Data data )
|
SlotTemplate<const Data>::SlotTemplate ( const string& name, const Data data )
|
||||||
: Slot(name), _data(data) { }
|
: Slot(name), _data(data) { }
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
SlotTemplate<Data>::SlotTemplate ( string& name, const Data data )
|
SlotTemplate<const Data>::SlotTemplate ( string& name, const Data data )
|
||||||
: Slot(name), _data(data) { }
|
: Slot(name), _data(data) { }
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
string SlotTemplate<Data>::getDataString () const { return getString(_data); }
|
string SlotTemplate<const Data>::getDataString () const { return getString(_data); }
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
Record* SlotTemplate<Data>::getDataRecord () const { return getRecord(_data); }
|
Record* SlotTemplate<const Data>::getDataRecord () const { return getRecord(_data); }
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
SlotTemplate<Data>* SlotTemplate<Data>::getClone () const
|
SlotTemplate<const Data>* SlotTemplate<const Data>::getClone () const
|
||||||
{ return new SlotTemplate(_name,_data); }
|
{ return new SlotTemplate(_name,_data); }
|
||||||
|
|
||||||
|
|
||||||
|
@ -175,16 +222,64 @@ namespace Hurricane {
|
||||||
: Slot(name), _data(data) {}
|
: Slot(name), _data(data) {}
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
string SlotTemplate<Data*>::getDataString () const { return getString(_data); }
|
string SlotTemplate<Data*>::getDataString () const { return ::getString(_data); }
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
Record* SlotTemplate<Data*>::getDataRecord () const { return getRecord(_data); }
|
Record* SlotTemplate<Data*>::getDataRecord () const { return ::getRecord(_data); }
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
SlotTemplate<Data*>* SlotTemplate<Data*>::getClone () const
|
SlotTemplate<Data*>* SlotTemplate<Data*>::getClone () const
|
||||||
{ return new SlotTemplate(_name,_data); }
|
{ return new SlotTemplate(_name,_data); }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "SlotTemplate".
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
class SlotTemplate<Data* const> : public Slot {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Constructor.
|
||||||
|
SlotTemplate ( const string& name, Data* const data );
|
||||||
|
SlotTemplate ( string& name, Data* const data );
|
||||||
|
// Accessors.
|
||||||
|
virtual string getDataString () const;
|
||||||
|
virtual Record* getDataRecord () const;
|
||||||
|
virtual SlotTemplate<Data* const>*
|
||||||
|
getClone () const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Internal: Attributes.
|
||||||
|
Data* const _data;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Internal: Constructors.
|
||||||
|
SlotTemplate ( const SlotTemplate& );
|
||||||
|
SlotTemplate& operator= ( const SlotTemplate& );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Inline Member Functions.
|
||||||
|
template<typename Data>
|
||||||
|
SlotTemplate<Data* const>::SlotTemplate ( const string& name, Data* const data )
|
||||||
|
: Slot(name), _data(data) {}
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
SlotTemplate<Data* const>::SlotTemplate ( string& name, Data* const data )
|
||||||
|
: Slot(name), _data(data) {}
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
string SlotTemplate<Data* const>::getDataString () const { return ::getString(_data); }
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
Record* SlotTemplate<Data* const>::getDataRecord () const { return ::getRecord(_data); }
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
SlotTemplate<Data* const>* SlotTemplate<Data* const>::getClone () const
|
||||||
|
{ return new SlotTemplate(_name,_data); }
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "SlotTemplate".
|
// Class : "SlotTemplate".
|
||||||
|
|
||||||
|
@ -233,13 +328,23 @@ namespace Hurricane {
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
inline Hurricane::Slot* getSlot( std::string& name, Data d )
|
inline Hurricane::Slot* getSlot( std::string& name, Data d )
|
||||||
{
|
{
|
||||||
|
//std::cerr << "getSlot<string&,Data>( \"" << name << "\" )" << std::endl;
|
||||||
return new Hurricane::SlotTemplate<Data> ( name, d );
|
return new Hurricane::SlotTemplate<Data> ( name, d );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<typename Data>
|
||||||
|
inline Hurricane::Slot* getSlot( std::string& name, Data* d )
|
||||||
|
{
|
||||||
|
//std::cerr << "getSlot<string&,Data*>( \"" << name << "\" )" << std::endl;
|
||||||
|
return new Hurricane::SlotTemplate<Data*> ( name, d );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
inline Hurricane::Slot* getSlot( const std::string& name, Data d )
|
inline Hurricane::Slot* getSlot( const std::string& name, Data d )
|
||||||
{
|
{
|
||||||
|
//std::cerr << "getSlot<const string&,Data>( \"" << name << "\" )" << std::endl;
|
||||||
return new Hurricane::SlotTemplate<Data> ( name, d );
|
return new Hurricane::SlotTemplate<Data> ( name, d );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,6 +352,7 @@ inline Hurricane::Slot* getSlot( const std::string& name, Data d )
|
||||||
template<typename Data>
|
template<typename Data>
|
||||||
inline Hurricane::Slot* getSlot( const std::string& name, Data* d )
|
inline Hurricane::Slot* getSlot( const std::string& name, Data* d )
|
||||||
{
|
{
|
||||||
|
//std::cerr << "getSlot<const string&,Data*>( \"" << name << "\" )" << std::endl;
|
||||||
return new Hurricane::SlotTemplate<Data*> ( name, d );
|
return new Hurricane::SlotTemplate<Data*> ( name, d );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#if !defined (DEMANGLE_H)
|
#if !defined (DEMANGLE_H)
|
||||||
#define DEMANGLE_H
|
#define DEMANGLE_H
|
||||||
|
|
||||||
#include "hurricane/libiberty.h"
|
//#include "hurricane/libiberty.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::History::push ( Slot* slot )
|
void InspectorWidget::History::push ( Slot* slot, Record* record )
|
||||||
{
|
{
|
||||||
if ( _depth < _slots.size()-1 ) {
|
if ( _depth < _slots.size()-1 ) {
|
||||||
while ( _depth < _slots.size()-1 ) pop ();
|
while ( _depth < _slots.size()-1 ) pop ();
|
||||||
|
@ -66,8 +66,9 @@ namespace Hurricane {
|
||||||
_depth++;
|
_depth++;
|
||||||
_slots.push_back ( slot->getClone() );
|
_slots.push_back ( slot->getClone() );
|
||||||
_comboBox->addItem ( QString("%1: %2").arg(_depth).arg(_slots[_slots.size()-1]->getDataString().c_str()));
|
_comboBox->addItem ( QString("%1: %2").arg(_depth).arg(_slots[_slots.size()-1]->getDataString().c_str()));
|
||||||
_comboBox->setCurrentIndex ( _depth );
|
//_comboBox->setCurrentIndex ( _depth );
|
||||||
|
|
||||||
|
//cerr << "After History::push()" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,8 +95,10 @@ namespace Hurricane {
|
||||||
void InspectorWidget::History::goTo ( int depth )
|
void InspectorWidget::History::goTo ( int depth )
|
||||||
{
|
{
|
||||||
if ( ( depth < 0 ) || ( depth >= (int)_slots.size() ) ) return;
|
if ( ( depth < 0 ) || ( depth >= (int)_slots.size() ) ) return;
|
||||||
|
if ( depth != _depth ) {
|
||||||
_depth = depth;
|
_depth = depth;
|
||||||
|
_comboBox->setCurrentIndex ( _depth );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -185,6 +188,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
QHeaderView* verticalHeader = _view->verticalHeader ();
|
QHeaderView* verticalHeader = _view->verticalHeader ();
|
||||||
verticalHeader->setVisible ( false );
|
verticalHeader->setVisible ( false );
|
||||||
|
verticalHeader->setDefaultSectionSize ( _rowHeight );
|
||||||
|
|
||||||
_historyComboBox = new QComboBox ( this );
|
_historyComboBox = new QComboBox ( this );
|
||||||
_history.setComboBox ( _historyComboBox );
|
_history.setComboBox ( _historyComboBox );
|
||||||
|
@ -218,13 +222,6 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::forceRowHeight ()
|
|
||||||
{
|
|
||||||
for ( int rows=_sortModel->rowCount()-1; rows >= 0 ; rows-- )
|
|
||||||
_view->setRowHeight ( rows, _rowHeight );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::setRootOccurrence ( Occurrence& occurrence )
|
void InspectorWidget::setRootOccurrence ( Occurrence& occurrence )
|
||||||
{
|
{
|
||||||
_rootOccurrence = occurrence;
|
_rootOccurrence = occurrence;
|
||||||
|
@ -241,12 +238,12 @@ namespace Hurricane {
|
||||||
|
|
||||||
void InspectorWidget::_setRootRecord ( Record* record )
|
void InspectorWidget::_setRootRecord ( Record* record )
|
||||||
{
|
{
|
||||||
|
//cerr << "InspectorWidget::_setRootRecord()." << endl;
|
||||||
//if ( _baseModel ) _baseModel->setSlot ( NULL, 0 );
|
//if ( _baseModel ) _baseModel->setSlot ( NULL, 0 );
|
||||||
|
|
||||||
_history.setRootRecord ( record );
|
if ( record == NULL ) _rootOccurrence = Occurrence ();
|
||||||
if ( !record ) _rootOccurrence = Occurrence ();
|
|
||||||
|
|
||||||
if ( !_baseModel ) {
|
if ( _baseModel == NULL ) {
|
||||||
_baseModel = new RecordModel ( this );
|
_baseModel = new RecordModel ( this );
|
||||||
_sortModel = new QSortFilterProxyModel ( this );
|
_sortModel = new QSortFilterProxyModel ( this );
|
||||||
_sortModel->setSourceModel ( _baseModel );
|
_sortModel->setSourceModel ( _baseModel );
|
||||||
|
@ -259,49 +256,53 @@ namespace Hurricane {
|
||||||
|
|
||||||
// Only after creating the RecordModel can we connect the ComboBox.
|
// Only after creating the RecordModel can we connect the ComboBox.
|
||||||
connect ( _historyComboBox, SIGNAL(currentIndexChanged(int))
|
connect ( _historyComboBox, SIGNAL(currentIndexChanged(int))
|
||||||
, this , SLOT(historyChanged(int)) );
|
, this , SLOT (historyChanged(int)) );
|
||||||
connect ( _baseModel, SIGNAL(layoutChanged()), this, SLOT(forceRowHeight()) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setSlot ();
|
_history.setRootRecord ( record );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool InspectorWidget::setSlot ()
|
bool InspectorWidget::setSlot ( Record* record )
|
||||||
{
|
{
|
||||||
bool change = true;
|
bool change = true;
|
||||||
|
|
||||||
change = _baseModel->setSlot ( _history.getSlot(), _history.getDepth() );
|
if ( (_history.getSlot() != NULL) and (record == NULL) )
|
||||||
// if ( change ) {
|
record = _history.getSlot()->getDataRecord();
|
||||||
// int rows = _sortModel->rowCount ();
|
|
||||||
// for ( rows-- ; rows >= 0 ; rows-- )
|
//cerr << " Effective setSlot() ." << endl;
|
||||||
// _view->setRowHeight ( rows, _rowHeight );
|
change = _baseModel->setSlot ( _history.getSlot(), record, _history.getDepth() );
|
||||||
// _view->selectRow ( 0 );
|
|
||||||
// }
|
|
||||||
|
|
||||||
return change;
|
return change;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::pushSlot ( Slot* slot )
|
void InspectorWidget::pushSlot ( Slot* slot, Record* record )
|
||||||
{
|
{
|
||||||
_history.push ( slot );
|
//cerr << "InspectorWidget::pushSlot()" << endl;
|
||||||
if ( !setSlot() )
|
|
||||||
_history.pop ();
|
if ( slot == NULL ) return;
|
||||||
|
if ( record == NULL ) {
|
||||||
|
record = slot->getDataRecord ();
|
||||||
|
if ( record == NULL ) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_history.push ( slot, record );
|
||||||
|
setSlot ( record );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::popSlot ()
|
void InspectorWidget::popSlot ()
|
||||||
{
|
{
|
||||||
_history.pop ();
|
_history.pop ();
|
||||||
setSlot ();
|
//setSlot ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::back ()
|
void InspectorWidget::back ()
|
||||||
{
|
{
|
||||||
_history.back ();
|
_history.back ();
|
||||||
setSlot ();
|
//setSlot ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -313,10 +314,11 @@ namespace Hurricane {
|
||||||
if ( keyEvent->key() == Qt::Key_Right ) {
|
if ( keyEvent->key() == Qt::Key_Right ) {
|
||||||
QModelIndex index = _view->currentIndex();
|
QModelIndex index = _view->currentIndex();
|
||||||
if ( index.isValid() ) {
|
if ( index.isValid() ) {
|
||||||
|
//cerr << "Key Right: do to sub-slot." << endl;
|
||||||
Slot* slot = _baseModel->getRecord()->getSlot(_sortModel->mapToSource(index).row());
|
Slot* slot = _baseModel->getRecord()->getSlot(_sortModel->mapToSource(index).row());
|
||||||
|
|
||||||
if ( slot )
|
if ( slot != NULL )
|
||||||
pushSlot ( slot );
|
pushSlot ( slot, slot->getDataRecord() );
|
||||||
}
|
}
|
||||||
} else if ( keyEvent->key() == Qt::Key_Left ) {
|
} else if ( keyEvent->key() == Qt::Key_Left ) {
|
||||||
back ();
|
back ();
|
||||||
|
@ -332,7 +334,6 @@ namespace Hurricane {
|
||||||
void InspectorWidget::textFilterChanged ()
|
void InspectorWidget::textFilterChanged ()
|
||||||
{
|
{
|
||||||
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
|
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
|
||||||
forceRowHeight ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,10 @@ namespace Hurricane {
|
||||||
|
|
||||||
RecordModel::RecordModel ( QObject* parent )
|
RecordModel::RecordModel ( QObject* parent )
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
, _slot(NULL)
|
, _slot (NULL)
|
||||||
, _record(NULL)
|
, _record (NULL)
|
||||||
, _depth(0)
|
, _depth (0)
|
||||||
|
, _cache ()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,30 +50,53 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool RecordModel::setSlot ( Slot* slot, size_t depth )
|
bool RecordModel::setSlot ( Slot* slot, Record* record, size_t depth )
|
||||||
{
|
{
|
||||||
if ( !slot ) {
|
//cerr << " Slot change" << endl;
|
||||||
_slot = NULL;
|
|
||||||
_record = NULL;
|
vector< pair<QVariant,QVariant> >().swap ( _cache );
|
||||||
_depth = depth;
|
|
||||||
|
if ( _slot ) {
|
||||||
|
delete _slot;
|
||||||
|
if ( _depth ) delete _record;
|
||||||
|
}
|
||||||
|
|
||||||
|
_slot = NULL;
|
||||||
|
_record = NULL;
|
||||||
|
_depth = depth;
|
||||||
|
|
||||||
|
if ( slot == NULL ) {
|
||||||
|
//cerr << " NULL Slot" << endl;
|
||||||
|
|
||||||
emit layoutChanged ();
|
emit layoutChanged ();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* record = slot->getDataRecord ();
|
// Now supplied by argument.
|
||||||
if ( !record ) {
|
if ( record == NULL ) {
|
||||||
delete slot;
|
record = slot->getDataRecord ();
|
||||||
return false;
|
//cerr << " New record build" << endl;
|
||||||
|
if ( record == NULL ) {
|
||||||
|
// cerr << " Slot " << slot->getDataString() << " has NULL Record" << endl;
|
||||||
|
|
||||||
|
delete slot;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( _depth ) delete _record;
|
//cerr << " New Slot [" << depth << "] " << slot->getDataString() << endl;
|
||||||
if ( _slot ) delete _slot;
|
|
||||||
|
|
||||||
_slot = slot;
|
_slot = slot;
|
||||||
_record = record;
|
_record = record;
|
||||||
_depth = depth;
|
_depth = depth;
|
||||||
|
|
||||||
|
Record::SlotVector& slotVector = _record->_getSlotVector();
|
||||||
|
Record::SlotVector::iterator islot = slotVector.begin();
|
||||||
|
for ( ; islot != slotVector.end() ; islot++ ) {
|
||||||
|
_cache.push_back ( make_pair(QVariant(getString((*islot)->getName()).c_str())
|
||||||
|
,QVariant((*islot)->getDataString().c_str())) );
|
||||||
|
}
|
||||||
|
|
||||||
emit layoutChanged ();
|
emit layoutChanged ();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -84,7 +108,7 @@ namespace Hurricane {
|
||||||
static QFont nameFont = Graphics::getFixedFont ( QFont::Bold );
|
static QFont nameFont = Graphics::getFixedFont ( QFont::Bold );
|
||||||
static QFont valueFont = Graphics::getFixedFont ( QFont::Normal, true );
|
static QFont valueFont = Graphics::getFixedFont ( QFont::Normal, true );
|
||||||
|
|
||||||
if ( !index.isValid() ) return QVariant ();
|
if ( not index.isValid() ) return QVariant ();
|
||||||
|
|
||||||
if ( role == Qt::SizeHintRole ) {
|
if ( role == Qt::SizeHintRole ) {
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
|
@ -94,6 +118,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( role == Qt::FontRole ) {
|
if ( role == Qt::FontRole ) {
|
||||||
|
//if ( index.row() == 0 ) return QVariant();
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0: return nameFont;
|
case 0: return nameFont;
|
||||||
case 1: return valueFont;
|
case 1: return valueFont;
|
||||||
|
@ -102,11 +127,13 @@ namespace Hurricane {
|
||||||
|
|
||||||
if ( role == Qt::DisplayRole ) {
|
if ( role == Qt::DisplayRole ) {
|
||||||
int row = index.row ();
|
int row = index.row ();
|
||||||
Slot* slot = _record->getSlot ( row );
|
//Slot* slot = _record->getSlot ( row );
|
||||||
if ( slot ) {
|
if ( row < _cache.size() ) {
|
||||||
switch ( index.column() ) {
|
switch ( index.column() ) {
|
||||||
case 0: return QVariant(slot->getName ().c_str());
|
case 0: return _cache[row].first;
|
||||||
case 1: return QVariant(slot->getDataString().c_str());
|
case 1: return _cache[row].second;
|
||||||
|
//case 0: return QVariant(slot->getName ().c_str());
|
||||||
|
//case 1: return QVariant(slot->getDataString().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,9 +145,14 @@ namespace Hurricane {
|
||||||
, Qt::Orientation orientation
|
, Qt::Orientation orientation
|
||||||
, int role ) const
|
, int role ) const
|
||||||
{
|
{
|
||||||
if ( ( orientation == Qt::Vertical ) || ( section > 1 ) || (role != Qt::DisplayRole) )
|
if ( ( orientation == Qt::Vertical ) or ( section > 1 ) )
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
|
static QFont headerFont = Graphics::getFixedFont ( QFont::Bold, false, false, +2 );
|
||||||
|
|
||||||
|
if ( role == Qt::FontRole ) return headerFont;
|
||||||
|
if ( role != Qt::DisplayRole ) return QVariant();
|
||||||
|
|
||||||
if ( section == 0 )
|
if ( section == 0 )
|
||||||
return QVariant ( tr("Object Attribute") );
|
return QVariant ( tr("Object Attribute") );
|
||||||
|
|
||||||
|
@ -130,7 +162,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
int RecordModel::rowCount ( const QModelIndex& parent ) const
|
int RecordModel::rowCount ( const QModelIndex& parent ) const
|
||||||
{
|
{
|
||||||
return (_record) ? _record->_getSlotList().size() : 0;
|
//return (_record != NULL) ? _record->_getSlotList().size() : 0;
|
||||||
|
return _cache.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ namespace Hurricane {
|
||||||
if ( !index.isValid() ) return QVariant ();
|
if ( !index.isValid() ) return QVariant ();
|
||||||
|
|
||||||
if ( role == Qt::SizeHintRole ) {
|
if ( role == Qt::SizeHintRole ) {
|
||||||
|
if ( index.row() == 0 ) return QVariant();
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0: return 200;
|
case 0: return 200;
|
||||||
default: return -1;
|
default: return -1;
|
||||||
|
@ -165,9 +166,14 @@ namespace Hurricane {
|
||||||
, Qt::Orientation orientation
|
, Qt::Orientation orientation
|
||||||
, int role ) const
|
, int role ) const
|
||||||
{
|
{
|
||||||
if ( ( orientation == Qt::Vertical ) || (role != Qt::DisplayRole) )
|
if ( orientation == Qt::Vertical )
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
|
static QFont headerFont = Graphics::getFixedFont ( QFont::Bold, false, false, +2 );
|
||||||
|
|
||||||
|
if ( role == Qt::FontRole ) return headerFont;
|
||||||
|
if ( role != Qt::DisplayRole ) return QVariant();
|
||||||
|
|
||||||
switch ( section ) {
|
switch ( section ) {
|
||||||
case 0: return "Path";
|
case 0: return "Path";
|
||||||
case 1: return "Entity";
|
case 1: return "Entity";
|
||||||
|
|
|
@ -118,6 +118,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( role == Qt::FontRole ) {
|
if ( role == Qt::FontRole ) {
|
||||||
|
if ( index.row() == 0 ) return QVariant();
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
default: return entityFont;
|
default: return entityFont;
|
||||||
}
|
}
|
||||||
|
@ -148,12 +149,17 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
QVariant SelectionPopupModel::headerData ( int section
|
QVariant SelectionPopupModel::headerData ( int section
|
||||||
, Qt::Orientation orientation
|
, Qt::Orientation orientation
|
||||||
, int role ) const
|
, int role ) const
|
||||||
{
|
{
|
||||||
if ( ( orientation == Qt::Vertical ) || (role != Qt::DisplayRole) )
|
if ( orientation == Qt::Vertical )
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
|
static QFont headerFont = Graphics::getFixedFont ( QFont::Bold, false, false, +2 );
|
||||||
|
|
||||||
|
if ( role == Qt::FontRole ) return headerFont;
|
||||||
|
if ( role != Qt::DisplayRole ) return QVariant();
|
||||||
|
|
||||||
if ( section == 0 ) {
|
if ( section == 0 ) {
|
||||||
return "Path+Entity";
|
return "Path+Entity";
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,6 @@ namespace Hurricane {
|
||||||
connect ( _filterPatternLineEdit, SIGNAL(textChanged(const QString &))
|
connect ( _filterPatternLineEdit, SIGNAL(textChanged(const QString &))
|
||||||
, this , SLOT (textFilterChanged()) );
|
, this , SLOT (textFilterChanged()) );
|
||||||
|
|
||||||
connect ( _baseModel , SIGNAL(layoutChanged()), this , SLOT(forceRowHeight()) );
|
|
||||||
connect ( _showSelection, SIGNAL(toggled(bool)) , this , SLOT(setShowSelection(bool)) );
|
connect ( _showSelection, SIGNAL(toggled(bool)) , this , SLOT(setShowSelection(bool)) );
|
||||||
connect ( _cumulative , SIGNAL(toggled(bool)) , this , SLOT(setCumulativeSelection(bool)) );
|
connect ( _cumulative , SIGNAL(toggled(bool)) , this , SLOT(setCumulativeSelection(bool)) );
|
||||||
connect ( clear , SIGNAL(clicked()) , _baseModel, SLOT(clear()) );
|
connect ( clear , SIGNAL(clicked()) , _baseModel, SLOT(clear()) );
|
||||||
|
@ -151,13 +150,6 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SelectionWidget::forceRowHeight ()
|
|
||||||
{
|
|
||||||
for ( int rows=_sortModel->rowCount()-1; rows >= 0 ; rows-- )
|
|
||||||
_view->setRowHeight ( rows, _rowHeight );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SelectionWidget::setCellWidget ( CellWidget* cw )
|
void SelectionWidget::setCellWidget ( CellWidget* cw )
|
||||||
{
|
{
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
|
@ -168,7 +160,7 @@ namespace Hurricane {
|
||||||
_cellWidget = cw;
|
_cellWidget = cw;
|
||||||
if ( !_cellWidget ) return;
|
if ( !_cellWidget ) return;
|
||||||
|
|
||||||
connect ( _cellWidget, SIGNAL(selectionModeChanged()), this , SLOT(changeSelectionMode()) );
|
connect ( _cellWidget, SIGNAL(selectionModeChanged()), this, SLOT(changeSelectionMode()) );
|
||||||
|
|
||||||
connect ( _cellWidget, SIGNAL(selectionChanged(const SelectorSet&))
|
connect ( _cellWidget, SIGNAL(selectionChanged(const SelectorSet&))
|
||||||
, this , SLOT (setSelection (const SelectorSet&)) );
|
, this , SLOT (setSelection (const SelectorSet&)) );
|
||||||
|
@ -232,7 +224,6 @@ namespace Hurricane {
|
||||||
void SelectionWidget::textFilterChanged ()
|
void SelectionWidget::textFilterChanged ()
|
||||||
{
|
{
|
||||||
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
|
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
|
||||||
forceRowHeight ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
History ();
|
History ();
|
||||||
~History ();
|
~History ();
|
||||||
void push ( Slot* slot );
|
void push ( Slot*, Record* );
|
||||||
void pop ();
|
void pop ();
|
||||||
void back ();
|
void back ();
|
||||||
void goTo ( int depth );
|
void goTo ( int depth );
|
||||||
|
@ -83,7 +83,6 @@ namespace Hurricane {
|
||||||
void setRootRecord ( Record* );
|
void setRootRecord ( Record* );
|
||||||
void setRootOccurrence ( Occurrence& );
|
void setRootOccurrence ( Occurrence& );
|
||||||
private slots:
|
private slots:
|
||||||
void forceRowHeight ();
|
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
void historyChanged ( int depth );
|
void historyChanged ( int depth );
|
||||||
void forkInspector ( const QModelIndex& );
|
void forkInspector ( const QModelIndex& );
|
||||||
|
@ -91,10 +90,10 @@ namespace Hurricane {
|
||||||
bool eventFilter ( QObject*, QEvent* );
|
bool eventFilter ( QObject*, QEvent* );
|
||||||
private:
|
private:
|
||||||
void _setRootRecord ( Record* );
|
void _setRootRecord ( Record* );
|
||||||
void pushSlot ( Slot* );
|
void pushSlot ( Slot*, Record* record=NULL );
|
||||||
void popSlot ();
|
void popSlot ();
|
||||||
void back ();
|
void back ();
|
||||||
bool setSlot ();
|
bool setSlot ( Record* record=NULL );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RecordModel* _baseModel;
|
RecordModel* _baseModel;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
// | Author : Jean-Paul CHAPUT |
|
// | Author : Jean-Paul CHAPUT |
|
||||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||||
// | =============================================================== |
|
// | =============================================================== |
|
||||||
// | C++ Header : "./NetlistModel.h" |
|
// | C++ Header : "./NetlistModel.h" |
|
||||||
// | *************************************************************** |
|
// | *************************************************************** |
|
||||||
// | U p d a t e s |
|
// | U p d a t e s |
|
||||||
// | |
|
// | |
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#ifndef __RECORD_MODEL_H__
|
#ifndef __RECORD_MODEL_H__
|
||||||
#define __RECORD_MODEL_H__
|
#define __RECORD_MODEL_H__
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
#include <QAbstractTableModel>
|
#include <QAbstractTableModel>
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
|
@ -67,7 +68,7 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
RecordModel ( QObject* parent=NULL );
|
RecordModel ( QObject* parent=NULL );
|
||||||
~RecordModel ();
|
~RecordModel ();
|
||||||
bool setSlot ( Slot* slot, size_t depth );
|
bool setSlot ( Slot* slot, Record* record, size_t depth );
|
||||||
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
||||||
int columnCount ( const QModelIndex& parent=QModelIndex() ) const;
|
int columnCount ( const QModelIndex& parent=QModelIndex() ) const;
|
||||||
QVariant data ( const QModelIndex& index, int role=Qt::DisplayRole ) const;
|
QVariant data ( const QModelIndex& index, int role=Qt::DisplayRole ) const;
|
||||||
|
@ -76,9 +77,10 @@ namespace Hurricane {
|
||||||
inline Slot* getSlot ();
|
inline Slot* getSlot ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Slot* _slot;
|
Slot* _slot;
|
||||||
Record* _record;
|
Record* _record;
|
||||||
size_t _depth;
|
size_t _depth;
|
||||||
|
std::vector< pair<QVariant,QVariant> > _cache;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,6 @@ namespace Hurricane {
|
||||||
void toggleSelection ();
|
void toggleSelection ();
|
||||||
void toggleSelection ( Occurrence );
|
void toggleSelection ( Occurrence );
|
||||||
void toggleSelection ( const QModelIndex& );
|
void toggleSelection ( const QModelIndex& );
|
||||||
void forceRowHeight ();
|
|
||||||
void inspect ();
|
void inspect ();
|
||||||
private slots:
|
private slots:
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
|
|
Loading…
Reference in New Issue