示例#1
0
void Relation::setType( const QString &type )
{
    int t = typeList().indexOf( type );
    if ( t == -1 ) {
        t = FinishStart;
    }
    m_type = static_cast<Type>( t );
}
int main(int argc, char *argv[]){

    mode_t fileType;
    char **nameList;
	int  i;
	
    if (argc!=3){ 
        usage();exit(1);
    }
    fileType=atoi(argv[2]);
    if ((fileType<1)||(fileType>TNL_UNIXSOCK)){
        usage();exit(2);
    }
    nameList=typeList(argv[1],fileType);
    for (i=0;nameList[i]!=(char *)0;i++){printf("[%d] <%s>\n",i,nameList[i]);}
												 
}
示例#3
0
QString TimeSeriesMotion::toHtml() const
{
    QString html;

    html += QString(
            "<tr>"
            "<td>%1</td>"
            "<td>%2</td>"
            "<td>%3</td>"
            "<td>%4</td>"
            "<td>%5</td>"
            "</tr>"
            )
            .arg(name())
            .arg(m_description)
            .arg(typeList().at(m_type))
            .arg(m_scale)
            .arg(m_pga);

    return html;
}
示例#4
0
QString Relation::typeToString( bool trans ) const
{
    return typeList( trans ).at( m_type );
}
#include <anax/ComponentFilter.hpp>

#include "Components.hpp"

const int MAXIMUM_AMOUNT_OF_COMPONENT_TYPES_TO_TEST = 3;


const lest::test specification[] =
{
    "Using require (1)", []
    {
        anax::ComponentFilter filter;
        filter.requires<PositionComponent, VelocityComponent>();

        anax::ComponentTypeList typeList(MAXIMUM_AMOUNT_OF_COMPONENT_TYPES_TO_TEST);

        typeList[PlayerComponent::GetTypeId()] = true;
        typeList[PositionComponent::GetTypeId()] = true;
        typeList[VelocityComponent::GetTypeId()] = true;

        EXPECT(filter.doesPassFilter(typeList));
    },

    "Using require (2)", []
    {
        anax::ComponentFilter filter;
        filter.requires<PositionComponent, VelocityComponent>();

        anax::ComponentTypeList typeList(MAXIMUM_AMOUNT_OF_COMPONENT_TYPES_TO_TEST);
示例#6
0
文件: gxType.cpp 项目: marcpage/gx
/** 
	@todo Still to setup
		Dispatch table methods
		Interface prototypes
		
*/
void Type::init() {
	static bool	inited= false;
	
	if(!inited) {
		Type	placeHolderType;
		
		inited= true;
		// create the types
		for(size_t type= 0; type < sizeof(gTypeBootStrapTable)/sizeof(gTypeBootStrapTable[0]); ++type) {
			const_cast<Type*>(gTypeBootStrapTable[type].type)->assign(new Extrinsic(placeHolderType, Type::kCountOfMembers), Pointer::DoNotRetain);
		}
		// create the interfaces
		for(size_t interface= 0; interface < sizeof(gInterfaceBootStrapTable)/sizeof(gInterfaceBootStrapTable[0]); ++interface) {
			gInterfaceBootStrapTable[interface].assign(new Extrinsic(Interface::type, Interface::kCountOfMembers), Pointer::DoNotRetain);
		}
		// assign interface of all interfaces
		for(size_t interface= 0; interface < sizeof(gInterfaceBootStrapTable)/sizeof(gInterfaceBootStrapTable[0]); ++interface) {
			gInterfaceBootStrapTable[interface]._interface= &gInterfaceBootStrapTable[iInterface].ref<GenericInstance>();
			Pointer::_retain(gInterfaceBootStrapTable[interface]._interface);
		}
		// initialize all Pointer types and interfaces
		for(size_t type= 0; type < sizeof(gTypeBootStrapTable)/sizeof(gTypeBootStrapTable[0]); ++type) {
			size_t	index= gTypeBootStrapTable[type].interfaceIndex;

			*const_cast<Type*>(gTypeBootStrapTable[type].type)= const_cast<GenericInstance*>(&Type::type.ref<GenericInstance>());
			*const_cast<Interface*>(gTypeBootStrapTable[type].interface)= gInterfaceBootStrapTable[index];
		}
		// set the name, parent and dispatches (and fill in interface of the dispatch)
		for(size_t type= 0; type < sizeof(gTypeBootStrapTable)/sizeof(gTypeBootStrapTable[0]); ++type) {
			size_t	index= gTypeBootStrapTable[type].interfaceIndex;
			List	dispatches(1);
			List	members(gTypeBootStrapTable[type].memberCount);
			List	constants(gTypeBootStrapTable[type].constantCount);
			
			dispatches.set(0, Dispatch(gInterfaceBootStrapTable[index]));
			const_cast<Type*>(gTypeBootStrapTable[type].type)->ref<Extrinsic>()[Name]= ASCIIText(gTypeBootStrapTable[type].name);
			const_cast<Type*>(gTypeBootStrapTable[type].type)->ref<Extrinsic>()[Parent]= Instance::type;
			const_cast<Type*>(gTypeBootStrapTable[type].type)->ref<Extrinsic>()[Dispatches]= dispatches;
			const_cast<Type*>(gTypeBootStrapTable[type].type)->ref<Extrinsic>()[Constants]= constants;
			const_cast<Type*>(gTypeBootStrapTable[type].type)->ref<Extrinsic>()[Members]= members;
		}
		
		// Fill in a list of all the known types so far
		List		typeList(sizeof(gTypeBootStrapTable)/sizeof(gTypeBootStrapTable[0]));
		
		for(size_t type= 0; type < sizeof(gTypeBootStrapTable)/sizeof(gTypeBootStrapTable[0]); ++type) {
			typeList.set(type, *gTypeBootStrapTable[type].type);
		}
		
		Type		*typeType= const_cast<Type*>(&Type::type); ///< Get Type's type to fix up
		List		&members= typeType->ref<Extrinsic>()[Members].ref<List>();
		List		&constants= typeType->ref<Extrinsic>()[Constants].ref<List>();
		Reference	allTypes(typeList);
		
		members.set(Name,		gInterfaceBootStrapTable[iText]);
		members.set(Parent,		gInterfaceBootStrapTable[iType]);
		members.set(Dispatches,	gInterfaceBootStrapTable[iList]);
		members.set(Constants,	gInterfaceBootStrapTable[iList]);
		members.set(Members,	gInterfaceBootStrapTable[iList]);
		constants.set(AllTypes,	allTypes);
		
		// call the init for every type
		for(size_t type= 0; type < sizeof(gTypeBootStrapTable)/sizeof(gTypeBootStrapTable[0]); ++type) {
			gTypeBootStrapTable[type].init();
		}
	}
}
示例#7
0
QString Document::typeToString( Document::Type type, bool trans )
{
    return typeList( trans ).at( type );
}