Doxygen - Can you add your own header in method description? - c++

Hello and thank you for reading.
I want to ask whether it is possible to add your own header in description of a method. I can not find any answer anywhere.
Lets say:
/**
* #brief Adds a Character to a container. That monster will be updated and drawn. The monster is not added if monster with samee ID exists
* #param m Character to add
* #return false if the character was not added.
*/
bool AddZombie(Zombie * m);
Now this will in doxygen create a field with bold headers saying "Parameters" and "Returns".
What I want, however, is to add a paragraph for a complexity. The following code does not do what I want, however
/**
* #brief Adds a Character to a container. That monster will be updated and drawn. The monster is not added if monster with samee ID exists
* #param m Character to add
* #return false if the character was not added.
* #complexity The complexity is O(n)
*/
bool AddZombie(Zombie * m);
Now is there any way to do this?
When I am asking here, please allow me to ask one small little question:
Would it be possible to make a list of all complexities of methods, maybe sorted? Meaning not by coding html, by only using doxygen.
This might seem like a stupid question to people who know alot about doxygen, but, allthough I red documentation and the website, I still sometimes learn something new and hidden I did not know.
Thank you all for any response.
Have a nice day, and thank you for your time

Related

Two entities with 2 join table in doctrine 2

I am working on courts projects. where 2 parties are involved. One party who filed the case against second party. each party may have more than 1 advocate for represent his case. and one advocate has more than 1 case. This situation is the many to many relationship. i designed this structure, this is the rough example.
How can i define such relationship in doctrine 2. I tried this
Advocate:
/**
* #ORM\ManyToMany(targetEntity="CaseLaw\CaseLaw\Entity\CaseLaw", mappedBy="caseLawFirstPartyAdvocates")
**/
private $caseLaw;
CaseLaw
/**
* #ORM\ManyToMany(targetEntity="CaseLaw\Advocates\Entity\Advocates", inversedBy="caseLaw")
* #ORM\JoinTable(name="case_law_first_party_advocates",
* joinColumns={#ORM\JoinColumn(name="case_law_id", referencedColumnName="case_law_id")},
* inverseJoinColumns={#ORM\JoinColumn(name="advocate_id", referencedColumnName="advocate_id")})
**/
private $caseLawFirstPartyAdvocates;
/**
* #ORM\ManyToMany(targetEntity = "Advocates", inversedBy="caseLaw")
* #ORM\JoinTable(name="case_law_first_party_advocates",
* joinColumns={#ORM\JoinColumn(name="case_law_id", referencedColumnName="case_law_id")},
* inverseJoinColumns={#ORM\JoinColumn(name="advocate_id", referencedColumnName="advocate_id")})
**/
private $caseLawSecondPartyAdovcates;
The Problem is, Value of MappedBy attribute is caseLawFirstPartyAdvocates, where i can specify second attribute caseLawsecondPartyAdvocates ?. how can i define annotation of this kink of situation ?
I don't have a direct answer to your question, but I'm going to recommend that you try http://www.orm-designer.com to help you figure it out. It's not free, but the developer is very active with updates, and us very responsive to suggestions and to support questions.

Fixed Step in Chart in C++ Builder

There is a TChart component in C++ Builde with one serie.
I add the data using AddXY method but I want the Y-Axis to have fixed minimum and maximum values and fixed step. I've managed to understand how the first two things are done.
So my question is: How can I define a fixed step for the Y-Axis in TChart component.
Important: I've tried using Increment property but it gives me distance from the origin and that's not what I want.
Chart1->LeftAxis->Automatic = false;
Chart1->LeftAxis->Minimum = M - 2 * S;
Chart1->LeftAxis->Maximum = M + 2 * S;
Chart1->LeftAxis->Increment = S;
Update: I'll try to explain more clearly what I want to be. After I defined the minimum and maximum for the chart, I want to make a fixed step for this. The code I posted above doesn't work properly because I need a fixed step beginning from Minimum value and not from zero value as the code in question does.
I've found the answer to my question. I appreciate that you were helping me. Thank you.
I just needed to change the Items propery of the axis.
Instead of Increment one should use
Chart1->LeftAxis->Items->Clear();
Chart1->LeftAxis->Items->Add(double Value);

How to create a game save file format in c++ using STL

I just learned about the i/o part of the STL, more specifically fstream. Although I can now save binary info and classes I've made to the hard drive, I am not sure how to define how the info should be read.
I saw the answer for making a file format from this post:
Typically you would define a lot of records/structures, such as
BITMAPINFOHEADER, and specify in what order they should come, how they
should be nestled, and you might need to write a lot of indices and
look-up tables. Such files consists of a number of records (maybe
nestled), look-up tables, magic words (indicating structure begin,
structures end, etc.) and strings in a custom-defined format.
What I want to know specifically is how to do this with the STL and C++...
Since the format is meant simply for the use of a game I would think it would be much easier though. The format should:
Be traversable (I can look through it and find the start of structure and maybe check its name
Be able to hold multiple classes and data in a single file
Have identifiable starts and ends to sections: such as the space in text files
Maybe have it's own icon to represent it??
How do I do this in c++ ?
The first stage in determining how to structure your save-file is determining what information needs to be stored. Presumably, you have a list of entities, each of which with generic information (probably derived from one of a few base classes), such as position, velocity etc.
One of the best things you can do to implement a map format is to have a save-parser for each class (some can just derive from the base class' save-parser). So for instance, if you have a player class, which derives from CBaseNPC, you could most-likely simply derive from CBaseNPC, override the parser, calling the base-class function, and adding any other necessary fields, for example, if we had (pseudocode):
void CBaseNPC::Save() {
SaveToFile( health );
SaveToFile( armor );
SaveToFile( weapons );
SaveToFile( position );
SaveToFile( angles );
}
Then for your player class:
void CPlayer::Save() {
CBaseNPC::Save();
SaveToFile( achievement_progress );
}
Obviously, this is just a simple example, and no doubt your saving parsers will have more fields etc. to deal with.
Dealing with the structure of the file itself, the main thing you need to worry about is delimiters, how will your main load-parser recognise what each field corresponds to?
I suppose the best way to explain this would be with an example, the following could be a simple start to a save-file:
Map: {mapname}
Gametime: {gametime}
===Player===
Health: {health}
Armor: {armor}
Weapons: {wep1 (wep1Ammo), wep2 (wep2Ammo), wep3 (wep3Ammo)}
Position: {x, y, z}
Angles: {yaw, pitch, roll} // Could be quaternion instead.
AchievementProgress: {arbritraryData}
===Player===
===NPC-npc_name===
Health: {health}
Armor: {armor}
Weapons: {wep1 (wep1Ammo), wep2 (wep2Ammo), wep3 (wep3Ammo)}
Position: {x, y, z}
Angles: {yaw, pitch, roll} // Could be quaternion instead.
===NPC-npc_name===
===Entity-item_name===
Position: {x, y, z}
Angles: {yaw, pitch, roll}
Model: {modelname}
===Entity-item_name===
Here we have used the "===" string as a delimiter for the start of a class's parameters, and a new line as the delimiter for the parameters within each class.
It is then a relatively simple matter of structuring your parser so it reads in the map name, and loads it. Then sets the game-time to the value specified in the save-file.
It then looks through the file until it finds a "===" reads the string it encounters, and looks it up from a dictionary (possibly an std::map or std::unordered_map) to determine the class to create (or edit) with the information in the file. Once it has determined the class type, it can then proceed to call the Load() function from that class, which will retrieve all the information contained. The parser then looks for the next instance of the "==={string encountered}===" and closes that class. It then proceeds following the same procedure with the next class encountered.
Sorry for the length of this post, and I'm sure it could be made briefer and there are probably some things I have missed, I just wrote this off the top of my head, so there may be erroneous things here, but I hope it puts you on the right path to getting a workable save-file format. :)
If you still have any problems or questions regarding my post, please comment, I'll do my best to answer promptly.

Redmine Wiki text is large

I am trying to use the Redmine wiki and I am having a hard time figuring out how to make the text not look so big. Here is a sample of the markup I am doing. Any suggestions on how to make the text not looks so big.
h1. Best Practices
==General==
* Detailed Names
==Python==
* Tabs Only (No space Indent)
* CapWord for classes
* lower_case_with_underscores for functions and variables
* UPPER_CASE_WITH_UNDERSCORES for Constants
After the heading h1 must be at least 1 empty line:
h1. Best Practices
==General==
* Detailed Names
==Python==
* Tabs Only (No space Indent)
* CapWord for classes
* lower_case_with_underscores for functions and variables
* UPPER_CASE_WITH_UNDERSCORES for Constants

doxygen comment multiple variables at once

If I have the following:
/**
* #brief (x,y,z) points for block
*/
int x, y, z;
It will only generate that documentation for x, is it possible in doxygen to get it to comment all x, y and z with one comment?
EDIT
Following the suggestions of envu I now have the following (based off http://www.doxygen.nl/manual/grouping.html#memgroup)
//#{
/** some documentation here */
int x, y, z;
//#}
or
//#{
/**
* #brief some documentation here
*/
int x, y, z;
//#}
However both of these still only document x.
Trying it with different forms I have yet to get the same documentation string to span multiple variables
Been banging my head on this one for a while. Turns out you have to set DISTRIBUTE_GROUP_DOC = YES in the configuration.
I would use member groups http://www.doxygen.nl/manual/grouping.html#memgroup for this. The syntax and output is a little bit different to what you want to achieve, but I think that shouldn't hurt.
I realize this is an old question, but I've been having a similar problem and found a workaround that doesn't exactly solve the problem but might be an acceptable substitute in certain cases.
By putting a comment above the member group block and prefixing it with the \name decorator, you get a description that shows up above all of the variables in the member group in the attributes list of the Doxygen page. I believe this is intended to be a short description, but you can put arbitrarily long descriptions here if you wish.
This doesn't have the effect of putting the same comments in the detail field for each of the variables in the member group (the detail fields will be empty, or if you put a comment inside the member group block it will still only apply to the first variable), but it does have the effect of documenting a related group of variables together, which seems like what the original intent of the question was.
Example:
/*! \name This will be the description for the following group of variables
It can be arbitrarily long, but the first line will show up in bold,
and any subsequent lines will show up like a description under it
*/
//#{
int relatedVariable1;
int relatedVariable2;
char* relatedVariable3;
//#}
I've set the option "DISTRIBUTE_GROUP_DOC" in the "Expert" tab. Then all the members of the group received the same comment.
//#{
/** same comment for all members */
char aaa;
char bbb;
int ccc;
//#}