data: extended tutorial to mention call/inheritance graphs
* fixed section mentioning hatched elements in tutorial * mention call/inheritance graphs in tutorial * added new tut files to windows deployment package
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
|
||||
#include "graph_tutorial_1.h"
|
||||
#include "graph_tutorial_5.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
@@ -59,7 +60,7 @@ public:
|
||||
// click the edge?
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
static int this_last_member;
|
||||
static ClickMeLater this_last_member;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -10,29 +10,23 @@ class ProducerOfTheLastMember
|
||||
public:
|
||||
void in()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member++;
|
||||
ClassWithHiddenMembers::this_last_member.produce();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// 7 - THAT'S IT
|
||||
// You completed the tutorial on the graph view. There is still more to learn
|
||||
// but I guess you will figure it out on your own. One last thing: If you see
|
||||
// an element with a hatched background please call us. It's a runaway!
|
||||
// Just kidding. Those are elements that are used within your code, but have no
|
||||
// definition anywhere in your source folder (like the "int" symbol on the
|
||||
// right hand side of the graph). So if you click them, Sourcetrail will display
|
||||
// all the relations for the element, but the code view won't show a
|
||||
// definition. If you want to learn more about Sourcetrail, go back to the central
|
||||
// hub. It is called in the function below but you can also try to get there
|
||||
// using only the graph.
|
||||
// 7 - ADVANCED TRAINING
|
||||
// Now that we have covered all the basics of navigating code using the graph,
|
||||
// I'd like to conclude this section of the tutorial by showing you a special
|
||||
// feature. Activate "ClickMeLater" in the far right of the graph when you are
|
||||
// ready.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
private:
|
||||
void the()
|
||||
{
|
||||
if (ClassWithHiddenMembers::this_last_member <= 0);
|
||||
if (ClassWithHiddenMembers::this_last_member.isPositive())
|
||||
{
|
||||
the_central_hub();
|
||||
}
|
||||
@@ -40,7 +34,7 @@ private:
|
||||
|
||||
void codeview()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member *= 2;
|
||||
ClassWithHiddenMembers::this_last_member.produce();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ class ConsumerOfTheLastMember
|
||||
public:
|
||||
void go()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member = 42;
|
||||
ClassWithHiddenMembers::this_last_member.consume();
|
||||
}
|
||||
|
||||
void on()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member--;
|
||||
ClassWithHiddenMembers::this_last_member.consume();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
//------------------------------------------------------------------------------
|
||||
void reading()
|
||||
{
|
||||
ClassWithHiddenMembers::this_last_member /= 2;
|
||||
ClassWithHiddenMembers::this_last_member.consume();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#ifndef GRAPH_TUTORIAL_5_H
|
||||
#define GRAPH_TUTORIAL_5_H
|
||||
|
||||
|
||||
|
||||
#include "graph_tutorial_6.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// 8 - EXPANDING THE SCOPE
|
||||
// Showing only one level of dependencies in the graph works well if you want
|
||||
// to get a quick overview on the parts of your codebase that are related to a
|
||||
// certain symbol. So using the graph makes sure that you don't overlook any
|
||||
// relation while planning to modify the source code. But sometimes that is not
|
||||
// enough.
|
||||
// Sometimes you are interested in a whole call graph for a certain function or
|
||||
// you want to see the complete inheritance chain of a specific class and you
|
||||
// want to expand the scope shown by the graph.
|
||||
// Do you see the small icon on the upper left of the graph? Use it to show the
|
||||
// depth graph controls and click the "show base hierarchy" button.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class ClickMeLater: public JustMoveOn, public NothingToSeeHere
|
||||
{
|
||||
public:
|
||||
void produce() { value++; }
|
||||
|
||||
void consume() { value--; }
|
||||
|
||||
bool isPositive() { return value > 0; }
|
||||
|
||||
int value;
|
||||
};
|
||||
|
||||
#endif // GRAPH_TUTORIAL_5_H
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#ifndef GRAPH_TUTORIAL_6_H
|
||||
#define GRAPH_TUTORIAL_6_H
|
||||
|
||||
|
||||
#include <string>
|
||||
|
||||
class BoringClass
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
//
|
||||
// 9 - THAT'S IT
|
||||
// Great work! You have found this previously hidden base class. Of course you
|
||||
// can also use the depth graph controls to expand the all classes that derive
|
||||
// from a selected symbol or, if the active symbol is a function or a method it
|
||||
// allows you to display the caller or callee graph.
|
||||
// You completed the tutorial on the graph view. There is still more to learn
|
||||
// but I guess you will figure it out on your own. One last thing: If you see
|
||||
// an element with a hatched background please call us. It's a runaway!
|
||||
// Just kidding. Those are elements that are used within your code, but have no
|
||||
// definition anywhere in your source folder (like the "string" symbol on the
|
||||
// right hand side of the graph). So if you click them, Sourcetrail will
|
||||
// display all the relations for the element, but the code view won't show a
|
||||
// definition. If you want to learn more about Sourcetrail, use the graph to go
|
||||
// back to the central hub.
|
||||
//
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
class click_me_to_continue
|
||||
{
|
||||
void method(std::string s)
|
||||
{
|
||||
the_central_hub();
|
||||
}
|
||||
};
|
||||
|
||||
class NothingToSeeHere: public BoringClass, public click_me_to_continue
|
||||
{
|
||||
};
|
||||
|
||||
class JustMoveOn
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
#endif // GRAPH_TUTORIAL_6_H
|
||||
|
||||
Reference in New Issue
Block a user