Esempio n. 1
0
ToggleComponentState* toggle_component_state_construct (GType object_type, Connection* outputWire, ComponentInst** ancestry, int ancestry_length1, ComponentInst* componentInst) {
	ToggleComponentState* self = NULL;
	Connection* _tmp0_ = NULL;
	Connection* _tmp1_ = NULL;
	ComponentInst** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	ComponentInst** _tmp3_ = NULL;
	gint _tmp3__length1 = 0;
	ComponentInst* _tmp4_ = NULL;
	ComponentInst* _tmp5_ = NULL;
	g_return_val_if_fail (outputWire != NULL, NULL);
	g_return_val_if_fail (componentInst != NULL, NULL);
	self = (ToggleComponentState*) component_state_construct (object_type);
	_tmp0_ = outputWire;
	_tmp1_ = _connection_ref0 (_tmp0_);
	_connection_unref0 (self->priv->outputWire);
	self->priv->outputWire = _tmp1_;
	self->priv->output = FALSE;
	_tmp2_ = ancestry;
	_tmp2__length1 = ancestry_length1;
	_tmp3_ = (_tmp2_ != NULL) ? _vala_array_dup37 (_tmp2_, _tmp2__length1) : ((gpointer) _tmp2_);
	_tmp3__length1 = _tmp2__length1;
	((ComponentState*) self)->ancestry = (_vala_array_free (((ComponentState*) self)->ancestry, ((ComponentState*) self)->ancestry_length1, (GDestroyNotify) component_inst_unref), NULL);
	((ComponentState*) self)->ancestry = _tmp3_;
	((ComponentState*) self)->ancestry_length1 = _tmp3__length1;
	_tmp4_ = componentInst;
	_tmp5_ = _component_inst_ref0 (_tmp4_);
	_component_inst_unref0 (((ComponentState*) self)->componentInst);
	((ComponentState*) self)->componentInst = _tmp5_;
	return self;
}
Esempio n. 2
0
ConstantComponentState* constant_component_state_construct (GType object_type, Connection* outputWire, gboolean constantValue, ComponentInst** ancestry, int ancestry_length1, ComponentInst* componentInst) {
	ConstantComponentState* self = NULL;
	Connection* _tmp0_;
	Connection* _tmp1_;
	gboolean _tmp2_;
	ComponentInst** _tmp3_;
	gint _tmp3__length1;
	ComponentInst** _tmp4_;
	gint _tmp4__length1;
	ComponentInst* _tmp5_;
	ComponentInst* _tmp6_;
	g_return_val_if_fail (outputWire != NULL, NULL);
	g_return_val_if_fail (componentInst != NULL, NULL);
	self = (ConstantComponentState*) component_state_construct (object_type);
	_tmp0_ = outputWire;
	_tmp1_ = _connection_ref0 (_tmp0_);
	_connection_unref0 (self->priv->outputWire);
	self->priv->outputWire = _tmp1_;
	_tmp2_ = constantValue;
	self->priv->output = _tmp2_;
	_tmp3_ = ancestry;
	_tmp3__length1 = ancestry_length1;
	_tmp4_ = (_tmp3_ != NULL) ? _vala_array_dup75 (_tmp3_, _tmp3__length1) : ((gpointer) _tmp3_);
	_tmp4__length1 = _tmp3__length1;
	((ComponentState*) self)->ancestry = (_vala_array_free (((ComponentState*) self)->ancestry, ((ComponentState*) self)->ancestry_length1, (GDestroyNotify) component_inst_unref), NULL);
	((ComponentState*) self)->ancestry = _tmp4_;
	((ComponentState*) self)->ancestry_length1 = _tmp4__length1;
	_tmp5_ = componentInst;
	_tmp6_ = _component_inst_ref0 (_tmp5_);
	_component_inst_unref0 (((ComponentState*) self)->componentInst);
	((ComponentState*) self)->componentInst = _tmp6_;
	return self;
}
Esempio n. 3
0
TristateComponentState* tristate_component_state_construct (GType object_type, Connection* inputWire, Connection* controlWire, Connection* outputWire, ComponentInst** ancestry, int ancestry_length1, ComponentInst* componentInst) {
	TristateComponentState* self = NULL;
	Connection* _tmp0_;
	Connection* _tmp1_;
	Connection* _tmp2_;
	Connection* _tmp3_;
	Connection* _tmp4_;
	Connection* _tmp5_;
	Connection* _tmp6_;
	Connection* _tmp7_;
	ComponentInst** _tmp8_;
	gint _tmp8__length1;
	ComponentInst** _tmp9_;
	gint _tmp9__length1;
	ComponentInst* _tmp10_;
	ComponentInst* _tmp11_;
	g_return_val_if_fail (inputWire != NULL, NULL);
	g_return_val_if_fail (controlWire != NULL, NULL);
	g_return_val_if_fail (outputWire != NULL, NULL);
	g_return_val_if_fail (componentInst != NULL, NULL);
	self = (TristateComponentState*) component_state_construct (object_type);
	_tmp0_ = inputWire;
	_tmp1_ = _connection_ref0 (_tmp0_);
	_connection_unref0 (self->priv->inputWire);
	self->priv->inputWire = _tmp1_;
	_tmp2_ = inputWire;
	connection_set_affects (_tmp2_, (ComponentState*) self);
	_tmp3_ = controlWire;
	_tmp4_ = _connection_ref0 (_tmp3_);
	_connection_unref0 (self->priv->controlWire);
	self->priv->controlWire = _tmp4_;
	_tmp5_ = controlWire;
	connection_set_affects (_tmp5_, (ComponentState*) self);
	_tmp6_ = outputWire;
	_tmp7_ = _connection_ref0 (_tmp6_);
	_connection_unref0 (self->priv->outputWire);
	self->priv->outputWire = _tmp7_;
	_tmp8_ = ancestry;
	_tmp8__length1 = ancestry_length1;
	_tmp9_ = (_tmp8_ != NULL) ? _vala_array_dup88 (_tmp8_, _tmp8__length1) : ((gpointer) _tmp8_);
	_tmp9__length1 = _tmp8__length1;
	((ComponentState*) self)->ancestry = (_vala_array_free (((ComponentState*) self)->ancestry, ((ComponentState*) self)->ancestry_length1, (GDestroyNotify) component_inst_unref), NULL);
	((ComponentState*) self)->ancestry = _tmp9_;
	((ComponentState*) self)->ancestry_length1 = _tmp9__length1;
	_tmp10_ = componentInst;
	_tmp11_ = _component_inst_ref0 (_tmp10_);
	_component_inst_unref0 (((ComponentState*) self)->componentInst);
	((ComponentState*) self)->componentInst = _tmp11_;
	return self;
}
Esempio n. 4
0
ClockComponentState* clock_component_state_construct (GType object_type, Connection* outputWire, gint onFor, gint offFor, ComponentInst** ancestry, int ancestry_length1, ComponentInst* componentInst) {
	ClockComponentState* self = NULL;
	Connection* _tmp0_;
	Connection* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	ComponentInst** _tmp5_;
	gint _tmp5__length1;
	ComponentInst** _tmp6_;
	gint _tmp6__length1;
	ComponentInst* _tmp7_;
	ComponentInst* _tmp8_;
	g_return_val_if_fail (outputWire != NULL, NULL);
	g_return_val_if_fail (componentInst != NULL, NULL);
	self = (ClockComponentState*) component_state_construct (object_type);
	_tmp0_ = outputWire;
	_tmp1_ = _connection_ref0 (_tmp0_);
	_connection_unref0 (self->priv->outputWire);
	self->priv->outputWire = _tmp1_;
	_tmp2_ = onFor;
	self->priv->onFor = _tmp2_;
	_tmp3_ = offFor;
	self->priv->offFor = _tmp3_;
	_tmp4_ = offFor;
	self->priv->nextToggle = _tmp4_;
	self->priv->output = FALSE;
	_tmp5_ = ancestry;
	_tmp5__length1 = ancestry_length1;
	_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup24 (_tmp5_, _tmp5__length1) : ((gpointer) _tmp5_);
	_tmp6__length1 = _tmp5__length1;
	((ComponentState*) self)->ancestry = (_vala_array_free (((ComponentState*) self)->ancestry, ((ComponentState*) self)->ancestry_length1, (GDestroyNotify) component_inst_unref), NULL);
	((ComponentState*) self)->ancestry = _tmp6_;
	((ComponentState*) self)->ancestry_length1 = _tmp6__length1;
	_tmp7_ = componentInst;
	_tmp8_ = _component_inst_ref0 (_tmp7_);
	_component_inst_unref0 (((ComponentState*) self)->componentInst);
	((ComponentState*) self)->componentInst = _tmp8_;
	return self;
}
MultiplexerComponentState* multiplexer_component_state_construct (GType object_type, Connection** selectWires, int selectWires_length1, Connection** dataWires, int dataWires_length1, Connection* outputWire, ComponentInst** ancestry, int ancestry_length1, ComponentInst* componentInst) {
	MultiplexerComponentState* self = NULL;
	Connection** _tmp0_ = NULL;
	gint _tmp0__length1 = 0;
	Connection** _tmp1_ = NULL;
	gint _tmp1__length1 = 0;
	Connection** _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	Connection** _tmp5_ = NULL;
	gint _tmp5__length1 = 0;
	Connection** _tmp6_ = NULL;
	gint _tmp6__length1 = 0;
	Connection** _tmp7_ = NULL;
	gint _tmp7__length1 = 0;
	Connection* _tmp10_ = NULL;
	Connection* _tmp11_ = NULL;
	ComponentInst** _tmp12_ = NULL;
	gint _tmp12__length1 = 0;
	ComponentInst** _tmp13_ = NULL;
	gint _tmp13__length1 = 0;
	ComponentInst* _tmp14_ = NULL;
	ComponentInst* _tmp15_ = NULL;
	g_return_val_if_fail (outputWire != NULL, NULL);
	g_return_val_if_fail (componentInst != NULL, NULL);
	self = (MultiplexerComponentState*) component_state_construct (object_type);
	_tmp0_ = selectWires;
	_tmp0__length1 = selectWires_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup29 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->selectWires = (_vala_array_free (self->priv->selectWires, self->priv->selectWires_length1, (GDestroyNotify) connection_unref), NULL);
	self->priv->selectWires = _tmp1_;
	self->priv->selectWires_length1 = _tmp1__length1;
	self->priv->_selectWires_size_ = self->priv->selectWires_length1;
	_tmp2_ = selectWires;
	_tmp2__length1 = selectWires_length1;
	{
		Connection** selectWire_collection = NULL;
		gint selectWire_collection_length1 = 0;
		gint _selectWire_collection_size_ = 0;
		gint selectWire_it = 0;
		selectWire_collection = _tmp2_;
		selectWire_collection_length1 = _tmp2__length1;
		for (selectWire_it = 0; selectWire_it < _tmp2__length1; selectWire_it = selectWire_it + 1) {
			Connection* _tmp3_ = NULL;
			Connection* selectWire = NULL;
			_tmp3_ = _connection_ref0 (selectWire_collection[selectWire_it]);
			selectWire = _tmp3_;
			{
				Connection* _tmp4_ = NULL;
				_tmp4_ = selectWire;
				connection_set_affects (_tmp4_, (ComponentState*) self);
				_connection_unref0 (selectWire);
			}
		}
	}
	_tmp5_ = dataWires;
	_tmp5__length1 = dataWires_length1;
	_tmp6_ = (_tmp5_ != NULL) ? _vala_array_dup30 (_tmp5_, _tmp5__length1) : ((gpointer) _tmp5_);
	_tmp6__length1 = _tmp5__length1;
	self->priv->dataWires = (_vala_array_free (self->priv->dataWires, self->priv->dataWires_length1, (GDestroyNotify) connection_unref), NULL);
	self->priv->dataWires = _tmp6_;
	self->priv->dataWires_length1 = _tmp6__length1;
	self->priv->_dataWires_size_ = self->priv->dataWires_length1;
	_tmp7_ = dataWires;
	_tmp7__length1 = dataWires_length1;
	{
		Connection** dataWire_collection = NULL;
		gint dataWire_collection_length1 = 0;
		gint _dataWire_collection_size_ = 0;
		gint dataWire_it = 0;
		dataWire_collection = _tmp7_;
		dataWire_collection_length1 = _tmp7__length1;
		for (dataWire_it = 0; dataWire_it < _tmp7__length1; dataWire_it = dataWire_it + 1) {
			Connection* _tmp8_ = NULL;
			Connection* dataWire = NULL;
			_tmp8_ = _connection_ref0 (dataWire_collection[dataWire_it]);
			dataWire = _tmp8_;
			{
				Connection* _tmp9_ = NULL;
				_tmp9_ = dataWire;
				connection_set_affects (_tmp9_, (ComponentState*) self);
				_connection_unref0 (dataWire);
			}
		}
	}
	_tmp10_ = outputWire;
	_tmp11_ = _connection_ref0 (_tmp10_);
	_connection_unref0 (self->priv->outputWire);
	self->priv->outputWire = _tmp11_;
	_tmp12_ = ancestry;
	_tmp12__length1 = ancestry_length1;
	_tmp13_ = (_tmp12_ != NULL) ? _vala_array_dup31 (_tmp12_, _tmp12__length1) : ((gpointer) _tmp12_);
	_tmp13__length1 = _tmp12__length1;
	((ComponentState*) self)->ancestry = (_vala_array_free (((ComponentState*) self)->ancestry, ((ComponentState*) self)->ancestry_length1, (GDestroyNotify) component_inst_unref), NULL);
	((ComponentState*) self)->ancestry = _tmp13_;
	((ComponentState*) self)->ancestry_length1 = _tmp13__length1;
	_tmp14_ = componentInst;
	_tmp15_ = _component_inst_ref0 (_tmp14_);
	_component_inst_unref0 (((ComponentState*) self)->componentInst);
	((ComponentState*) self)->componentInst = _tmp15_;
	return self;
}
Esempio n. 6
0
OrComponentState* or_component_state_construct (GType object_type, Connection** inputWires, int inputWires_length1, Connection* outputWire, ComponentInst** ancestry, int ancestry_length1, ComponentInst* componentInst) {
	OrComponentState* self = NULL;
	Connection** _tmp0_;
	gint _tmp0__length1;
	Connection** _tmp1_;
	gint _tmp1__length1;
	Connection** _tmp2_;
	gint _tmp2__length1;
	Connection* _tmp5_;
	Connection* _tmp6_;
	ComponentInst** _tmp7_;
	gint _tmp7__length1;
	ComponentInst** _tmp8_;
	gint _tmp8__length1;
	ComponentInst* _tmp9_;
	ComponentInst* _tmp10_;
	g_return_val_if_fail (outputWire != NULL, NULL);
	g_return_val_if_fail (componentInst != NULL, NULL);
	self = (OrComponentState*) component_state_construct (object_type);
	_tmp0_ = inputWires;
	_tmp0__length1 = inputWires_length1;
	_tmp1_ = (_tmp0_ != NULL) ? _vala_array_dup32 (_tmp0_, _tmp0__length1) : ((gpointer) _tmp0_);
	_tmp1__length1 = _tmp0__length1;
	self->priv->inputWires = (_vala_array_free (self->priv->inputWires, self->priv->inputWires_length1, (GDestroyNotify) connection_unref), NULL);
	self->priv->inputWires = _tmp1_;
	self->priv->inputWires_length1 = _tmp1__length1;
	self->priv->_inputWires_size_ = self->priv->inputWires_length1;
	_tmp2_ = inputWires;
	_tmp2__length1 = inputWires_length1;
	{
		Connection** inputWire_collection = NULL;
		gint inputWire_collection_length1 = 0;
		gint _inputWire_collection_size_ = 0;
		gint inputWire_it = 0;
		inputWire_collection = _tmp2_;
		inputWire_collection_length1 = _tmp2__length1;
		for (inputWire_it = 0; inputWire_it < _tmp2__length1; inputWire_it = inputWire_it + 1) {
			Connection* _tmp3_;
			Connection* inputWire = NULL;
			_tmp3_ = _connection_ref0 (inputWire_collection[inputWire_it]);
			inputWire = _tmp3_;
			{
				Connection* _tmp4_;
				_tmp4_ = inputWire;
				connection_set_affects (_tmp4_, (ComponentState*) self);
				_connection_unref0 (inputWire);
			}
		}
	}
	_tmp5_ = outputWire;
	_tmp6_ = _connection_ref0 (_tmp5_);
	_connection_unref0 (self->priv->outputWire);
	self->priv->outputWire = _tmp6_;
	_tmp7_ = ancestry;
	_tmp7__length1 = ancestry_length1;
	_tmp8_ = (_tmp7_ != NULL) ? _vala_array_dup33 (_tmp7_, _tmp7__length1) : ((gpointer) _tmp7_);
	_tmp8__length1 = _tmp7__length1;
	((ComponentState*) self)->ancestry = (_vala_array_free (((ComponentState*) self)->ancestry, ((ComponentState*) self)->ancestry_length1, (GDestroyNotify) component_inst_unref), NULL);
	((ComponentState*) self)->ancestry = _tmp8_;
	((ComponentState*) self)->ancestry_length1 = _tmp8__length1;
	_tmp9_ = componentInst;
	_tmp10_ = _component_inst_ref0 (_tmp9_);
	_component_inst_unref0 (((ComponentState*) self)->componentInst);
	((ComponentState*) self)->componentInst = _tmp10_;
	return self;
}