|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78397 - in sandbox/icl/libs/xplore/br1/sqlbrowser: . Dag
From: afojgo_at_[hidden]
Date: 2012-05-09 18:20:13
Author: jofaber
Date: 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
New Revision: 78397
URL: http://svn.boost.org/trac/boost/changeset/78397
Log:
Created some Objects for the dag model.
Text files modified:
sandbox/icl/libs/xplore/br1/sqlbrowser/Dag.h | 34 ++++++++++--
sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.cpp | 102 ----------------------------------------
sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.h | 2
sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp | 2
sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp | 2
sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro | 2
6 files changed, 30 insertions(+), 114 deletions(-)
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/Dag.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/Dag.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/Dag.h 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
@@ -29,7 +29,7 @@
// this class, to add more information to graph nodes.
//
// The contents of this class is associated to the graph using tags:
-// attribute_tag, boost::property<attribute_tag, VertexAttributes>
+// vertex_attr_tag, boost::property<vertex_attr_tag, VertexAttributes>
class VertexAttributes
{
public:
@@ -66,6 +66,21 @@
DagItem* p_parentItem;
};
+class EdgeAttributes
+{
+public:
+ EdgeAttributes(): m_nodeId() {}
+ EdgeAttributes(const QString& name, int id): m_nodeId(id) {}
+
+private:
+ int m_nodeId;
+
+ //---- Db::Object associated to the Edge ---------------------------------
+ dag::db::tObjectSharedPtr m_pObject;
+
+ //---- DagModel ------------------------------------------------------------
+};
+
//JODO: m_depth/depth() may be removed. It's currently only needed for debugging.
namespace dag
@@ -101,18 +116,23 @@
struct Dag
{
- // The kind of attribute_tag is a vertex_property_tag
- struct attribute_tag { typedef boost::vertex_property_tag kind; };
+ // The kind of vertex_attr_tag is a vertex_property_tag
+ struct vertex_attr_tag { typedef boost::vertex_property_tag kind; };
+
+ // The kind of edge_attr_tag is a edge_property_tag
+ struct edge_attr_tag { typedef boost::edge_property_tag kind; };
// Here we associate a real type for content 'VertexAttributes' to the tag type
- // attribute_tag -> VertexAttributes
- typedef boost::property<attribute_tag, VertexAttributes> tAttributeTag;
+ // vertex_attr_tag -> VertexAttributes
+ typedef boost::property<vertex_attr_tag, VertexAttributes> tVertexAttrTag;
+ typedef boost::property<edge_attr_tag, EdgeAttributes> tEdgeAttrTag;
typedef boost::adjacency_list
< boost::vecS
, boost::vecS
, boost::directedS
- , tAttributeTag
+ , tVertexAttrTag
+ , tEdgeAttrTag
> DagType;
typedef DagType type;
@@ -120,7 +140,7 @@
typedef DagType::edge_descriptor edge_descriptor;
//
- typedef boost::property_map<Dag::type, attribute_tag>::type tAttributesMap;
+ typedef boost::property_map<Dag::type, vertex_attr_tag>::type tAttributesMap;
typedef std::map<vertex_descriptor, vertex_descriptor> tParentMap;//CL
};
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.cpp 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
@@ -4,106 +4,4 @@
-class TypeTraits
-{
-public:
- static const int ciMaxBitCount = 64;
- typedef std::bitset<ciMaxBitCount> tTraitSet;
-private:
- tTraitSet m_aTraitSet;
-};
-
-
-bool dag::db::isBuiltIn(const TypeTraits& aTraits);
-bool dag::db::isAtom(const TypeTraits& aTraits);
-bool isComposite(const TypeTraits& aTraits);
-
-
-
-
-/*
-bool isBuiltIn(const TypeTraits& aTraits);
-bool isAtom(const TypeTraits& aTraits);
-bool isComposite(const TypeTraits& aTraits);
-
-
-//! TypeSignature: The sequence of Types of an Objects
-//! Fields. The fields that contain all 1:1 Relationships
-//! that an object has in a given model.
-class TypeSignature
-{
-public:
-private:
- tKeySequence m_aTypeSequence;
-};
-
-//! FieldSignature: The sequence of Fields of an Object.
-class FieldSignature
-{
-public:
-private:
- tKeySequence m_aFieldSequence;
-};
-
-
-//Don't optimize premature: Clearness first!!
-//I have to prepare and build the TypeGraph first.
-//
-
-class ObjectType
-{
-public:
-private:
- tKey m_uKey;
- TypeTraits m_aTraits;
- tString m_aName;
- TypeSignature m_aTypeSeq;
- FieldSignature m_aFieldSeq;
-};
-
-typedef boost::scoped_ptr<ObjectType> tObjectTypeUniPtr;
-typedef ObjectType* tObjectTypeRawPtr;
-typedef const ObjectType* tConstObjectTypeRawPtr;
-
-
-class EdgeType
-{
-public:
-private:
- tKey m_uKey;
- tString m_aName;
- tObjectTypeUniPtr m_pSourceType;
- tObjectTypeUniPtr m_pRelationType;
- tObjectTypeUniPtr m_pTargetType;
-};
-
-
-//==============================================================================
-//= dag::db::Objects
-//==============================================================================
-
-
-
-//! dag::db::Object is a fairly general and thus boring object.
-//! It has a db::Type which determines the flat type of data record m_aValue.
-template<class Type>
-class Object
-{
-public:
- Object(): m_aType(){};
- explicit Object(Type aType): m_aType(aType){};
-private:
- Type m_aType;
- tVariVector m_aValue;
-};
-
-typedef boost::scoped_ptr<Object> tObjectUniPtr;
-typedef Object* tObjectRawPtr;
-typedef const Object* tObjectConstRawPtr;
-
-*/
-
-}} //namespace dag { namespace db
-
-
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.h
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.h (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/Dag/DbType.h 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
@@ -124,8 +124,6 @@
//= dag::db::Objects
//==============================================================================
-
-
//! dag::db::Object is a fairly general and thus boring object.
//! It has a db::Type which determines the flat type of data record m_aValue.
template<class Type>
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/browser.cpp 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
@@ -302,7 +302,7 @@
q.exec("insert into Names values (4, 'Sherlock', 'Holmes', 'London')");
connectionWidget->refresh();
} else {
- int dlgPort = dialog.port();
+ //int dlgPort = dialog.port();
QSqlError err = addConnection(dialog.driverName(), dialog.databaseName(), dialog.hostName(),
dialog.userName(), dialog.password(), dialog.port());
if (err.type() != QSqlError::NoError)
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/dagmodel.cpp 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
@@ -367,7 +367,7 @@
{
m_dag.clear();
- m_aVertexAttributes = get(Dag::attribute_tag(), m_dag);
+ m_aVertexAttributes = get(Dag::vertex_attr_tag(), m_dag);
for(tEdgeList::iterator iter = m_edges.begin(); iter != m_edges.end(); iter++)
{
Modified: sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro
==============================================================================
--- sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro (original)
+++ sandbox/icl/libs/xplore/br1/sqlbrowser/sqlbrowser4.pro 2012-05-09 18:20:12 EDT (Wed, 09 May 2012)
@@ -3,7 +3,7 @@
QT += sql
-INCLUDEPATH += /NIBuild/3rdparty/boost-1.48.0
+INCLUDEPATH += /cygwin/home/jofa/dev/boost/branches/release
#INCLUDEPATH += /cygwin/home/jofa/dev/boost/trunk
HEADERS = browser.h connectionwidget.h qsqlconnectiondialog.h \
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk