Ejemplo n.º 1
0
//${HSMs::QHsmTst::SM::s::s2::s21::s211} .....................................
Q_STATE_DEF(QHsmTst, s211) {
    QP::QState status_;
    switch (e->sig) {
        //${HSMs::QHsmTst::SM::s::s2::s21::s211}
        case Q_ENTRY_SIG: {
            BSP_display("s211-ENTRY;");
            status_ = Q_RET_HANDLED;
            break;
        }
        //${HSMs::QHsmTst::SM::s::s2::s21::s211}
        case Q_EXIT_SIG: {
            BSP_display("s211-EXIT;");
            status_ = Q_RET_HANDLED;
            break;
        }
        //${HSMs::QHsmTst::SM::s::s2::s21::s211::H}
        case H_SIG: {
            BSP_display("s211-H;");
            status_ = tran(&s);
            break;
        }
        //${HSMs::QHsmTst::SM::s::s2::s21::s211::D}
        case D_SIG: {
            BSP_display("s211-D;");
            status_ = tran(&s21);
            break;
        }
        default: {
            status_ = super(&s21);
            break;
        }
    }
    return status_;
}
PushNotificationReceiveJob::PushNotificationReceiveJob(OsIndependentContext* context)
{
  super(context, JobParameters.newBuilder()
    .withRequirement(new NetworkRequirement(context))
    .withGroupId("__notification_received")
    .withWakeLock(true, 30, TimeUnit.SECONDS).create());
}
Ejemplo n.º 3
0
/**
 * @fn MainView *MainView::initWithFrame(MainView *self, const SDL_Rect *frame)
 * @memberof MainView
 */
static MainView *initWithFrame(MainView *self, const SDL_Rect *frame) {

	self = (MainView *) super(View, self, initWithFrame, frame);
	if (self) {

		Outlet outlets[] = MakeOutlets(
			MakeOutlet("background", &self->background),
			MakeOutlet("logo", &self->logo),
			MakeOutlet("version", &self->version),
			MakeOutlet("contentView", &self->contentView),
			MakeOutlet("primaryMenu", &self->primaryMenu),
			MakeOutlet("secondaryMenu", &self->secondaryMenu)
		);

		View *this = (View *) self;

		$(this, awakeWithResourceName, "ui/main/MainView.json");
		$(this, resolve, outlets);

		this->stylesheet = $$(Stylesheet, stylesheetWithResourceName, "ui/main/MainView.css");
		assert(this->stylesheet);
		
		$(self->background, setImageWithResourceName, va("ui/backgrounds/%d.tga", Random() % 6));
		$(self->logo, setImageWithResourceName, "ui/logo.tga");

		$(self->version->text, setText, va("Quetoo %s", cgi.GetCvarString("version")));
	}

	return self;
}
Ejemplo n.º 4
0
Archivo: ex1.c Proyecto: shiift/CSE4095
int main()
{
    int i, n;
    int p[100001];  /* p[0] is not used */

    for(;;)
    {
        (void)scanf( "%d", &n);

        if( n==0 ) return 0;

        for( i = 1; i <= n; i++ )
        {
           (void)scanf( "%d", p+i );
        }

        if( super(n, p) )
        {
            printf( "super\n" );
        }
        else
        {
            printf( "not super\n" );
        }
    }
}
Ejemplo n.º 5
0
EntityZombie(World EntityZombie::world) 
{
        super(world);
        texture = "/mob/zombie.png";
        moveSpeed = 0.5;
        attackStrength = 5;
}
Ejemplo n.º 6
0
//${Comp::Philo::SM::thinking} ...............................................
Q_STATE_DEF(Philo, thinking) {
    QP::QState status_;
    switch (e->sig) {
        //${Comp::Philo::SM::thinking}
        case Q_ENTRY_SIG: {
            m_timeEvt.armX(think_time(), 0U);
            status_ = Q_RET_HANDLED;
            break;
        }
        //${Comp::Philo::SM::thinking}
        case Q_EXIT_SIG: {
            (void)m_timeEvt.disarm();
            status_ = Q_RET_HANDLED;
            break;
        }
        //${Comp::Philo::SM::thinking::TIMEOUT}
        case TIMEOUT_SIG: {
            status_ = tran(&hungry);
            break;
        }
        //${Comp::Philo::SM::thinking::TEST}
        case TEST_SIG: {
            status_ = Q_RET_HANDLED;
            break;
        }
        default: {
            status_ = super(&top);
            break;
        }
    }
    return status_;
}
Ejemplo n.º 7
0
/**
 * @see Object::isEqual(const Object *, const Object *)
 */
static _Bool isEqual(const Object *self, const Object *other) {

	if (super(Object, self, isEqual, other)) {
		return true;
	}

	if (other && (self->clazz == other->clazz)) {

		const Error *this = (Error *) self;
		const Error *that = (Error *) other;

		if (this->code == that->code) {

			if ($((Object * ) this->domain, isEqual, (Object * ) that->domain)) {

				if (this->message) {
					return $((Object * ) this->message, isEqual, (Object * ) that->message);
				}

				return that->message == NULL;
			}
		}
	}

	return false;
}
Ejemplo n.º 8
0
/**
 * @fn PlayerModelView *PlayerModelView::init(PlayerModelView *self)
 *
 * @memberof PlayerModelView
 */
static PlayerModelView *initWithFrame(PlayerModelView *self, const SDL_Rect *frame) {

	self = (PlayerModelView *) super(View, self, initWithFrame, frame);
	if (self) {
		self->view.backgroundColor = Colors.Charcoal;
		self->view.backgroundColor.a = 64;

		self->animation1.animation = ANIM_TORSO_STAND1;
		self->animation2.animation = ANIM_LEGS_RUN;

		const SDL_Rect iconFrame = MakeRect(0, 0, 64, 64);

		self->iconView = $(alloc(ImageView), initWithFrame, &iconFrame);
		assert(self->iconView);

		self->iconView->view.alignment = ViewAlignmentTopRight;

		$((View *) self, addSubview, (View *) self->iconView);

		self->view.padding.top = 4;
		self->view.padding.right = 4;
		self->view.padding.bottom = 4;
		self->view.padding.left = 4;
	}

	return self;
}
Ejemplo n.º 9
0
  foreach (const CloudComposerItem* input_item, input_data)
  {  
    QVariant variant = input_item->data (ItemDataRole::CLOUD_TEMPLATED);
    typename PointCloud <PointT>::Ptr input_cloud = variant.value <typename PointCloud<PointT>::Ptr> ();
    
    float resolution = parameter_model_->getProperty("Resolution").toFloat ();
    qDebug () << "Octree resolution = "<<resolution;
    float seed_resolution = parameter_model_->getProperty("Seed Resolution").toFloat ();
    qDebug () << "Seed resolution = "<<seed_resolution;
    
    float rgb_weight = parameter_model_->getProperty("RGB Weight").toFloat ();
    float normal_weight = parameter_model_->getProperty("Normals Weight").toFloat ();
    float spatial_weight = parameter_model_->getProperty("Spatial Weight").toFloat ();
    
  
    pcl::SupervoxelClustering<PointT> super (resolution, seed_resolution);
    super.setInputCloud (input_cloud);
    super.setColorImportance (rgb_weight);
    super.setSpatialImportance (spatial_weight);
    super.setNormalImportance (normal_weight);
    std::map <uint32_t, typename pcl::Supervoxel<PointT>::Ptr > supervoxel_clusters;
    super.extract (supervoxel_clusters);
    
    std::map <uint32_t, typename pcl::Supervoxel<PointT>::Ptr > refined_supervoxel_clusters;
    super.refineSupervoxels (3, refined_supervoxel_clusters);
  
    typename pcl::PointCloud<PointXYZRGBA>::Ptr color_segments;
    color_segments= super.getColoredVoxelCloud ();
    
    CloudItem*  cloud_item_out = CloudItem::createCloudItemFromTemplate<PointXYZRGBA>(input_item->text(),color_segments);
 
    
    output.append (cloud_item_out);
    
  }
Ejemplo n.º 10
0
/**
 * @see View::updateBindings(View *)
 */
static void updateBindings(View *self) {

	super(View, self, updateBindings);

	TextView *this = (TextView *) self;

	free(this->defaultText);
	this->defaultText = NULL;

	MutableArray *keys = $$(MutableArray, array);
	SDL_Scancode key = SDL_SCANCODE_UNKNOWN;
	while (true) {
		key = cgi.KeyForBind(key, ((BindTextView *) this)->bind);
		if (key == SDL_SCANCODE_UNKNOWN) {
			break;
		}

		$(keys, addObject, str(cgi.KeyName(key)));
	}

	if (keys->array.count) {
		String *keyNames = $((Array *) keys, componentsJoinedByCharacters, ", ");
		this->defaultText = strdup(keyNames->chars);
		release(keyNames);
	}

	release(keys);
}
Ejemplo n.º 11
0
// SS4 signalling:
void ss4Signal(int signal) {
    if(signal==49) { // A
        mf(15);
        delay(250);
        sf(2400,350);
        return;
    }
    if(signal==50) { // B
        signal==11;
    }
    if(signal==51) { // C
        signal==12;
    }
    if(signal==52) { // D
        sf(2600,750);
        return;
    }
    if(signal==-13) {
        signal = 10;
    }
    if(signal==-6) { //
        super();
        return;
    }
    for(int i=0; i<=3; i++) {
        (ss4[signal][i]) ? freq[0].play(ss4Tone[1],35) : freq[0].play(ss4Tone[0],35);
        delay(70);
    }
    return;
}
Ejemplo n.º 12
0
QScriptValue ScriptableSyntaxDefinition::KEYWORD_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1);
	QString keys = context->argument(0).toString();
	NODE node = super(context)->KEYWORD(keys.toUtf8());
	return nodeToScriptValue(engine, node);
}
Ejemplo n.º 13
0
QScriptValue ScriptableSyntaxDefinition::NOT_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1);
	NODE entry = context->argument(0).toVariant().value<NODE>();
	NODE node = super(context)->NOT(entry);
	return nodeToScriptValue(engine, node);
}
Ejemplo n.º 14
0
QScriptValue ScriptableSyntaxDefinition::EXCEPT_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1, 2);
	if (context->argumentCount() == 2) {
		QChar a = context->argument(0).toString().at(0);
		QChar b = context->argument(1).toString().at(0);
		NODE node = super(context)->EXCEPT(a, b);
		return nodeToScriptValue(engine, node);
	}
	else if (context->argumentCount() == 1) {
		QString s = context->argument(0).toString();
		NODE node = super(context)->EXCEPT(s.constData());
		return nodeToScriptValue(engine, node);
	}
	return QScriptValue();
}
Ejemplo n.º 15
0
QScriptValue ScriptableSyntaxDefinition::STRING_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1);
	QString s = context->argument(0).toString();
	NODE node = super(context)->STRING(s.constData());
	return nodeToScriptValue(engine, node);
}
Ejemplo n.º 16
0
// our main() function:
void loop(void) { // Here we just get the button, pressed or held, and 2600 switch
    char button = keypad.getKey(); // check for button press
    if(digitalRead(10)==HIGH) { // play 2600Hz if top button pressed
        super(); // supervisory signalling
    }
    return; // end main()
}
Ejemplo n.º 17
0
static void *Iterable_destructor (void *_self)
{
    struct Iterable *self = cast (Iterable (), _self);
    Class_destructor_m dtor = method (super (Iterable ()), "__destructor__");

    return dtor (self);
}
Ejemplo n.º 18
0
//${Comp::Philo::SM::eating} .................................................
Q_STATE_DEF(Philo, eating) {
    QP::QState status_;
    switch (e->sig) {
        //${Comp::Philo::SM::eating}
        case Q_ENTRY_SIG: {
            m_timeEvt.armX(eat_time(), 0U);
            status_ = Q_RET_HANDLED;
            break;
        }
        //${Comp::Philo::SM::eating}
        case Q_EXIT_SIG: {
            (void)m_timeEvt.disarm();

            // asynchronously post event to the Container
            TableEvt *pe = Q_NEW(TableEvt, DONE_SIG);
            pe->philo = this;
            AO_Table->postLIFO(pe);
            status_ = Q_RET_HANDLED;
            break;
        }
        //${Comp::Philo::SM::eating::TIMEOUT}
        case TIMEOUT_SIG: {
            status_ = tran(&thinking);
            break;
        }
        default: {
            status_ = super(&top);
            break;
        }
    }
    return status_;
}
Ejemplo n.º 19
0
/**
 * @fn Array *Array::initWithObjects(Array *self, ...)
 *
 * @memberof Array
 */
static Array *initWithObjects(Array *self, ...) {

	self = (Array *) super(Object, self, init);
	if (self) {

		va_list args;
		va_start(args, self);

		while (va_arg(args, ident)) {
			self->count++;
		}

		va_end(args);

		if (self->count) {

			self->elements = calloc(self->count, sizeof(ident));
			assert(self->elements);

			va_start(args, self);

			for (size_t i = 0; i < self->count; i++) {
				self->elements[i] = retain(va_arg(args, ident));
			}

			va_end(args);
		}
	}

	return self;
}
Ejemplo n.º 20
0
/**
 * @see Object::isEqual(const Object *, const Object *)
 */
static _Bool isEqual(const Object *self, const Object *other) {

	if (super(Object, self, isEqual, other)) {
		return true;
	}

	if (other && $(other, isKindOfClass, &_Array)) {

		const Array *this = (Array *) self;
		const Array *that = (Array *) other;

		if (this->count == that->count) {

			for (size_t i = 0; i < this->count; i++) {

				const Object *thisObject = this->elements[i];
				const Object *thatObject = that->elements[i];

				if ($(thisObject, isEqual, thatObject) == false) {
					return false;
				}
			}

			return true;
		}
	}

	return false;
}
Ejemplo n.º 21
0
QScriptValue ScriptableSyntaxDefinition::OTHER_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1);
	QChar ch = context->argument(0).toString().at(0);
	NODE node = super(context)->OTHER(ch);
	return nodeToScriptValue(engine, node);
}
Ejemplo n.º 22
0
QScriptValue ScriptableSyntaxDefinition::ENTRY_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1);
	const char* name = 0;
	constCharFromScriptValue(context->argument(0), name);
	super(context)->ENTRY(name);
	return QScriptValue();
}
Ejemplo n.º 23
0
QScriptValue ScriptableSyntaxDefinition::GLUE_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 2, intMax);
	NODE node = super(context)->GLUE();
	for (int i = 0, n = context->argumentCount(); i < n; ++i)
		node->appendChild(context->argument(i).toVariant().value<NODE>());
	return nodeToScriptValue(engine, node);
}
Ejemplo n.º 24
0
/**
 * @see Object::dealloc(Object *)
 */
static void dealloc(Object *self) {

	Option *this = (Option *) self;

	release(this->title);

	super(Object, self, dealloc);
}
Ejemplo n.º 25
0
/**
 * @see Object::dealloc(Object *)
 */
static void dealloc(Object *self) {

	PlayerModelView *this = (PlayerModelView *) self;

	release(this->iconView);

	super(Object, self, dealloc);
}
Ejemplo n.º 26
0
QScriptValue ScriptableSyntaxDefinition::VARSTRING_(QScriptContext* context, QScriptEngine* engine)
{
	checkNumberOfArguments(context, 1);
	const char* name = 0;
	constCharFromScriptValue(context->argument(0), name);
	NODE node = super(context)->VARSTRING(name);
	return nodeToScriptValue(engine, node);
}
Ejemplo n.º 27
0
EntityPainting(World EntityPainting::world) 
{
        super(world);
        field_695_c = 0;
        direction = 0;
        yOffset = 0.0F;
        setSize(0.5, 0.5);
}
Ejemplo n.º 28
0
Grid::Grid(int w, int h)
{
	width = winWidth = w;
	height = winHeight = h;
	num = w*h;
	
	super();
}
Ejemplo n.º 29
0
/**
 * @see Object::dealloc(Object *)
 */
static void dealloc(Object *self) {

	BindTextView *this = (BindTextView *) self;

	free(this->bind);

	super(Object, self, dealloc);
}
Ejemplo n.º 30
0
ofxScene::ofxScene( ofxPath  _x, ofxPath  _y, ofxPath  _z, ofxPath  _t, ofxPath _alpha, ofxPath _xR, ofxPath _yR, ofxPath _zR) {
    super( _x, _y, _z, _t, new Path( 255 ), new Path( 255 ), new Path( 255 ), _alpha, _xR, _yR, _zR );
    ready  = false;
    scenes = new ArrayList();
    name   = this.getClass().getName();
    String[] temp = splitTokens( name, "$" );
    name   = temp[ temp.length - 1 ];
};