Exemplo n.º 1
0
	void validate()
	{
		// check for cyclic inheritance
		IInterface* base = _baseType;
		while( base )
		{
			if( base == _myType )
				CORAL_THROW( IllegalStateException, "cyclic inheritance detected'" );
			base = base->getBaseType();
		}

		_myType->updateSuperTypes();

		// check for member clashes, considering all super types
		IInterface* type = _myType;
		Range<IInterface* const> superTypes = type->getSuperTypes();
		while( 1 )
		{
			Range<IMember* const> members = type->getMembers();
			for( ; members; members.popFirst() )
				checkForMemberClashes( members.getFirst() );

			if( !superTypes )
				break;

			type = superTypes.getFirst();
			superTypes.popFirst();
		}
	}
Exemplo n.º 2
0
	void validate()
	{
		Range<IPort* const> ports = _myType->getPorts();
		IPort* lastPort = ports.getFirst();
		for( ports.popFirst(); ports; ports.popFirst() )
		{
			if( lastPort->getName() == ports.getFirst()->getName() )
				CORAL_THROW( IllegalNameException, "duplicate port '" << lastPort->getName()
					<< "' in component '" << _myType->getFullName() << "'" );
		}
	}
Exemplo n.º 3
0
void System::setupBase( Range<std::string const> requiredModules )
{
	if( _state != SystemState_None )
		throw IllegalStateException( "the system's state is not SystemState_None" );

	_state = SystemState_Initializing;

	try
	{
		for( ; requiredModules; requiredModules.popFirst() )
			_modules->load( requiredModules.getFirst() );
	}
	catch( ... )
	{
		_state = SystemState_None;
		throw;
	}

	_state = SystemState_Integrating;

	_modules->updateModules( ModuleState_Integrated );

	_state = SystemState_Integrated;
}
Exemplo n.º 4
0
	void validate()
	{
		Range<IMember* const> members = static_cast<ICompositeType*>( _type.get() )->getMembers();
		for( ; members; members.popFirst() )
			checkForMemberClashes( members.getFirst() );
	}
Exemplo n.º 5
0
RangeIterator<T> begin(Range<T> R)
{
    return RangeIterator<T>(R.getFirst(), R.getInc());
}