C++ reverse fails

Please use this forum to signal bugs.
Merci d'utiliser ce forum pour signaler des bugs.

C++ reverse fails

Postby dwysok » Mon 28 Oct 2013 13:33

Hi,
I am trying to reverse C++ header files. It seems to fail on union inside struct TuningParams and refuses to process the rest of the file.
Is there any chance I can tell BOUML that the union syntax is correct ?

I am using BOUML 6.4.7 under ubuntu 12.04.

/Darek

// Copyright (c) 2002 Zenterio AB
//
// Author:
// XXX, Zenterio AB

#ifndef BAL_ITUNER_HH
#define BAL_ITUNER_HH

#include <map>
#include <vector>

#include <zinc/evt.hh>

namespace bal
{

/**
* Specifies the value of the west/east flag
*
*/
enum WestEastFlag {
WEST = 0,
EAST
};

enum Polarization {
HORIZONTAL,
VERTICAL,
CIRCULAR_LEFT,
CIRCULAR_RIGHT
};

/**
* Specifying the inner forward error correction used
*
*/
enum DvbcFecInner {
DVBC_FEC_INNER_NOT_DEFINED = 0,
DVBC_FEC_1_2,
DVBC_FEC_2_3,
DVBC_FEC_3_4,
DVBC_FEC_5_6,
DVBC_FEC_7_8,
DVBC_FEC_8_9,
DVBC_FEC_3_5,
DVBC_FEC_4_5,
DVBC_FEC_9_10,
DVBC_NO_CONV_CODING = 0xf
};

/**
* Specifying the inner forward error correction used
*
*/
enum DvbsFecInner {
DVBS_FEC_INNER_NOT_DEFINED = 0,
DVBS_FEC_1_2,
DVBS_FEC_2_3,
DVBS_FEC_3_4,
DVBS_FEC_5_6,
DVBS_FEC_7_8,
DVBS_FEC_8_9, // S2
DVBS_FEC_3_5, // S2
DVBS_FEC_4_5, // S2
DVBS_FEC_9_10, // S2
DVBS_NO_CONV_CODING = 0xf
};

/**
* Specifying the outer forward error correction used
*
*/
enum FecOuter {
FEC_OUTER_NOT_DEFINED = 0,
NO_OUTER_FEC,
RS_204_188
};

/**
* Specifies bandwidth in DVB-T
*
*/
enum Bandwidth {
BW_8_MHZ,
BW_7_MHZ,
BW_6_MHZ,
BW_5_MHZ, // T2
BW_10_MHZ, // T2
BW_1_712_MHZ // T2
/* RESERVED = 0110 - 1111 */
};

/**
* Specifies the constellation (DVB-T/T2)
*
*/
enum DvbtConstellation {
DVBT_QPSK,
DVBT_QAM_16,
DVBT_QAM_64,
DVBT_QAM_256 //T2
};


/**
* Specifies the code rate used
*
*/
enum CodeRate {
DVBT_FEC_1_2,
DVBT_FEC_2_3,
DVBT_FEC_3_4,
DVBT_FEC_5_6,
DVBT_FEC_7_8,
DVBT_FEC_3_5, // T2
DVBT_FEC_4_5, // T2
DVBT_NO_CONV_CODING
};

/**
* Specifies the guard interval used
*
*/
enum GuardInterval {
GUARD_1_32,
GUARD_1_16,
GUARD_1_8,
GUARD_1_4,
GUARD_1_128, // T2
GUARD_19_128, // T2
GUARD_19_256 // T2
/* RESERVED = 111 */
};

/**
* Specifies the transmission mode used
*
*/
enum TransmissionMode {
MODE_2K,
MODE_8K,
MODE_4K,
MODE_1K, // T2
MODE_16K, // T2
MODE_32K // T2
/* RESERVED = 110 - 111 */
};

/**
* Specifies the cable modulation
*
*/
enum CableModulation {
DVBC_MODULATION_NOT_DEFINED = 0,
DVBC_QAM_16,
DVBC_QAM_32,
DVBC_QAM_64,
DVBC_QAM_128,
DVBC_QAM_256
};

enum SatModulation {
DVBS_AUTO = 0,
DVBS_QPSK,
DVBS_8PSK, // S2
DVBS_16QAM // S2
};

/**
* Specifies whether the the transmission is hierarchical, and if so
* what the alpha value is.
*
*/
enum HierarchyInformation {
NON_HIERARCHICAL = 0,
HIERARCHICAL_ALPHA_1,
HIERARCHICAL_ALPHA_2,
HIERARCHICAL_ALPHA_4
};

/**
* Specifies the roll-off factor used
* Only defined for S2
*/
enum RollOffFactor {
ROLLOFF_035 = 0,
ROLLOFF_025,
ROLLOFF_020,
ROLLOFF_NA // incase of non S2
};

enum AtscBandwidth {
ATSC_BW_6_MHZ = 0
};

enum AtscModulation {
ATSC_MOD_VSB_8 = 0
};

/**
* \brief Tuning information
*/
struct TuningParams
{
TuningParams() :
m_Type(NONE)
{}
enum {NONE, TERRESTRIAL, CABLE, SATELLITE, ATSC_TERR} m_Type;
union {
struct { // terrestrial params
uint32_t m_TerrFreqHz;
HierarchyInformation m_Hierarchy;
CodeRate m_CodeRateHp;
CodeRate m_CodeRateLp;
DvbtConstellation m_Constellation;
Bandwidth m_Bandwidth;
TransmissionMode m_TransmissionMode;
GuardInterval m_GuardInterval;
bool m_T2; // true if DVB-T2
uint8_t m_PlpId; // PlpId if DVB-T2
uint16_t m_SystemId; // SystemId if DVB-T2
};
struct { // cable params
uint32_t m_CabFreqHz;
CableModulation m_CabModulation;
uint32_t m_CabSymbolRate;
};
struct { // satellite params
uint32_t m_FreqKHz;
int16_t m_OrbitalPosition; // 0.1 deg, positive is east
uint32_t m_SymbolRate;
SatModulation m_SatModulation;
Polarization m_Polarization;
DvbsFecInner m_FecInner;
};
struct { // atsc terrestrial params
uint32_t m_AtscTerrFreqHz;
AtscBandwidth m_AtscBw;
AtscModulation m_AtscMod;
};
};
};


/**
* \brief Interface for tuners
*
* \note Sends bal::ITuner::TuningEvent
*/
class ITuner : public evt::EventGenerator
{
public:
void foo(void) =0;
};

} // namespace

#endif // BAL_ITUNER_HH
dwysok
 
Posts: 3
Joined: Mon 28 Oct 2013 12:32

Re: C++ reverse fails

Postby Bruno Pagès » Mon 28 Oct 2013 17:25

Hi,

The reverse (roundtrip) is disturbed because the embedded struct/union are unnamed (not struct S { ... }; ) and not used to type an attribute (not struct { ... } s; )

To be modelled and visible in the browser the (sub) struct/union/enum/class/typedef must be named.

Best regards,
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 474
Joined: Mon 20 Feb 2012 08:23
Location: France

Re: C++ reverse fails

Postby dwysok » Thu 7 Nov 2013 08:54

Hi,

I understand there is no way to tell BOUML to at least ignore unamed struct/union.
So in order to use BOUML in my project I have to name all struct/union, right ?

rgds
Darek
dwysok
 
Posts: 3
Joined: Mon 28 Oct 2013 12:32

Re: C++ reverse fails

Postby Bruno Pagès » Thu 7 Nov 2013 09:41

Yes.

What is the interest to have unnamed struct/union ?
ImageAuthor of Bouml
Bruno Pagès
 
Posts: 474
Joined: Mon 20 Feb 2012 08:23
Location: France

Re: C++ reverse fails

Postby dwysok » Thu 7 Nov 2013 11:00

Some developers uses them as a way of encapsulation. However
there's been discussions about support of anonymous structs and unions in different C/C++ standards.
The best practice is to avoid them. So I will use this case as a kick to clean up the code.
dwysok
 
Posts: 3
Joined: Mon 28 Oct 2013 12:32


Return to Bug reports / Rapports de bugs

Who is online

Users browsing this forum: No registered users and 3 guests

cron