suspend implementation on typedef

christian.templier christian.templier@wanadoo.fr
Sat Dec 11 04:17:00 GMT 1999


I work on the new language PTBL : Parrallel and transactional 
behaviour language
on corba interface .
 
I have a lot of problems to compile generate code like that 
:
 
(SEGMENT::LIST can not be found in SECTOR because SEGMENT is 
define after SECTOR ... )

 
template < class T > 
class BACK_REF
{public :
typedef  T  REFERENCE 
;
} ;
 
class SECTOR ;
 
class SEGMENT ;
 
typedef BACK_REF<SECTOR>::REFERENCE SECTOR_REF 
;
 
typedef BACK_REF<SEGMENT>::REFERENCE SEGMENT_REF 
;
 
class OBJECT_BASE 
{public : /* ... */ 
    virtual int Append(OBJECT_BASE *object) ;
static int _FAIL 
static int _SUCCESS ;
} ;
 
template < class T>
TEMPLATE_LIST : public OBJECT_BASE
{public : /* ... 
*/   
    virtual int Append(OBJECT_BASE *object) 
        {T* 
_obj=dynamic_cast<T*>(object));/* check the syntaxe ?*/
        if (_obj!=NULL)
            
{return(Append(_obj));
            }
        else
            {throw 
OBJECT_BASE::_FAIL ;
            }
        } ; 
    virtual int Append(T *object) 
            {/* ... 
*/ return(OBJECT_BASE::_SUCCESS);
            } 
;
} ;
class SECTOR : public OBJECT_BASE
{public :{/* ... */
class LIST : public TEMPLATE_LIST<SECTOR>
    {{/* ... 
*/
    } ;
 
typedef char * NAME ;
 
SECTOR (NAME name);
 
NAME _name ;
 
typedef SEGMENT_REF::LIST SEGMENTS ;
 
SEGMENTS flights_segments ;
 
virtual 
SEGMENT_REF ActivateFlight(int flightId); 
 
virtual 
OBJECT_BASE *CreateList() ; 
 
virtual SEGMENT_REF::LIST *Flights() ;
 
 
} ;
 
class SEGMENT : public OBJECT_BASE
{public : {/* ... */ 
class LIST : public TEMPLATE_LIST<SEGMENT>
    {/* ... 
*/
    virtual int Append(OBJECT_BASE *object) ;
    } ;
SECTOR_REF::LIST 
next_sectors;
 
SEGMENT(int flightId) ;
 
int  _flightId ; 
 
virtual 
OBJECT_BASE *CreateList() ; 
 
virtual int 
Activate (SECTOR_REF::LIST *nextSectors) ;
 
} ;
 
class SECTOR_SPECIALIZED : 
public SECTOR
{ 
class LIST : public TEMPLATE_LIST<SECTOR_SPECIALIZED 
>
    {/* ... 
*/
    int Append(OBJECT_BASE 
*object) ;
    } ; 
 
virtual OBJECT_BASE *CreateList() 
; 
} ;
 
class SEGMENT_SPECIALIZED : public SEGMENT
{ 
class LIST : public TEMPLATE_LIST<SEGMENT_SPECIALIZED 
>
    {/* ... 
*/
    int Append(OBJECT_BASE 
*object) ;
    } ; 
 
virtual 
OBJECT_BASE *CreateList() ; 
} ;
 
 
I would like SECTOR and SEGMENT do not be a templates 
.
 
I hope you will take this request and implement a new version 
of compiler gcc2.95
 
 
 
thanks for your answer .
 
regards
Christian TEMPLIER .
 
 



More information about the Gcc-bugs mailing list