void *
tiz_loadedtoidle_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizloaded = tiz_get_type (ap_hdl, "tizloaded");
  void * tizloadedtoidle_class
    = factory_new (classOf (tizloaded), "tizloadedtoidle_class",
                   classOf (tizloaded), sizeof (tiz_loadedtoidle_class_t),
                   ap_tos, ap_hdl, ctor, loadedtoidle_class_ctor, 0);
  return tizloadedtoidle_class;
}
Exemple #2
0
static void *Iterator_next (void *_self)
{
    struct Iterator *self = cast (Iterator (), _self);
    Iterable_next_m nextm = method (classOf (self->iterable), "next");
    Iterator_get_m get = method (classOf (self), "get");

    self->current = nextm (self->iterable, self);

    return get (self);
}
void *
gmusic_cfgport_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizconfigport = tiz_get_type (ap_hdl, "tizconfigport");
  void * gmusiccfgport_class
    = factory_new (classOf (tizconfigport), "gmusiccfgport_class",
                   classOf (tizconfigport), sizeof (gmusic_cfgport_class_t),
                   ap_tos, ap_hdl, ctor, gmusic_cfgport_class_ctor, 0);
  return gmusiccfgport_class;
}
void *
cc_youtube_cfgport_class_init (void * ap_tos, void * ap_hdl)
{
  void * cc_cfgport = tiz_get_type (ap_hdl, "cc_cfgport");
  void * cc_youtubecfgport_class
    = factory_new (classOf (cc_cfgport), "cc_youtubecfgport_class",
                   classOf (cc_cfgport), sizeof (cc_youtube_cfgport_class_t),
                   ap_tos, ap_hdl, ctor, cc_youtube_cfgport_class_ctor, 0);
  return cc_youtubecfgport_class;
}
void *
tiz_idletoloaded_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizidle = tiz_get_type (ap_hdl, "tizidle");
  void * tizidletoloaded_class
    = factory_new (classOf (tizidle), "tizidletoloaded_class",
                   classOf (tizidle), sizeof (tiz_idletoloaded_class_t), ap_tos,
                   ap_hdl, ctor, idletoloaded_class_ctor, 0);
  return tizidletoloaded_class;
}
void *
scloud_cfgport_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizconfigport = tiz_get_type (ap_hdl, "tizconfigport");
  void * scloudcfgport_class
    = factory_new (classOf (tizconfigport), "scloudcfgport_class",
                   classOf (tizconfigport), sizeof (scloud_cfgport_class_t),
                   ap_tos, ap_hdl, ctor, scloud_cfgport_class_ctor, 0);
  return scloudcfgport_class;
}
void *
tiz_pausetoidle_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizpause = tiz_get_type (ap_hdl, "tizpause");
  void * tizpausetoidle_class
    = factory_new (classOf (tizpause),
                   "tizpausetoidle_class",
                   classOf (tizpause),
                   sizeof (tiz_pausetoidle_class_t),
                   ap_tos, ap_hdl,
                   ctor, pausetoidle_class_ctor, 0);
  return tizpausetoidle_class;
}
void *
tiz_waitforresources_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizstate = tiz_get_type (ap_hdl, "tizstate");
  void * tizwaitforresources_class
    = factory_new (classOf (tizstate),
                   "tizwaitforresources_class",
                   classOf (tizstate),
                   sizeof (tiz_waitforresources_class_t),
                   ap_tos, ap_hdl,
                   ctor, waitforresources_class_ctor, 0);
  return tizwaitforresources_class;
}
void *httpsrc_port_class_init (void *ap_tos, void *ap_hdl)
{
  void *tizaudioport = tiz_get_type (ap_hdl, "tizaudioport");
  void *httpsrcport_class = factory_new
      /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
      (classOf (tizaudioport), "httpsrcport_class", classOf (tizaudioport), sizeof(httpsrc_port_class_t),
       /* TIZ_CLASS_COMMENT: */
       ap_tos, ap_hdl,
       /* TIZ_CLASS_COMMENT: class constructor */
       ctor, httpsrc_port_class_ctor,
       /* TIZ_CLASS_COMMENT: stop value*/
       0);
  return httpsrcport_class;
}
void *vorbisd_prc_class_init (void *ap_tos, void *ap_hdl)
{
  void *tizfilterprc = tiz_get_type (ap_hdl, "tizfilterprc");
  void *vorbisdprc_class = factory_new
    /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
    (classOf (tizfilterprc), "vorbisdprc_class", classOf (tizfilterprc), sizeof(vorbisd_prc_class_t),
     /* TIZ_CLASS_COMMENT: */
     ap_tos, ap_hdl,
     /* TIZ_CLASS_COMMENT: class constructor */
     ctor,vorbisd_prc_class_ctor,
     /* TIZ_CLASS_COMMENT: stop value*/
     0);
  return vorbisdprc_class;
}
void *
tiz_demuxercfgport_class_init (void * ap_tos, void * ap_hdl)
{
  void * tizuricfgport = tiz_get_type (ap_hdl, "tizuricfgport");
  void * tizdemuxercfgport_class = factory_new
    /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
    (classOf (tizuricfgport), "tizdemuxercfgport_class", classOf (tizuricfgport), sizeof (tiz_demuxercfgport_class_t),
     /* TIZ_CLASS_COMMENT: */
     ap_tos, ap_hdl,
     /* TIZ_CLASS_COMMENT: class constructor */
     ctor, demuxercfgport_class_ctor,
     /* TIZ_CLASS_COMMENT: stop value*/
                                                0);
  return tizdemuxercfgport_class;
}
//Flushes this output stream and forces any buffered output bytes to be written out. The general contract of flush is that calling it is an indication that, if any bytes previously written have been buffered by the implementation of the output stream, such bytes should immediately be written to their intended destination.
//
//The flush method of OutStream does nothing. 
void flush(void * _self) {
  struct OutputStreamClass * _class =(struct OutputStreamClass *)classOf(_self); 
  
  assert(_class -> flush);
	
	_class -> flush(_self);
}
//Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream.
void writeByte(void * _self,uchar b) {
  struct OutputStreamClass * _class =(struct OutputStreamClass *)classOf(_self); 
  
  assert(_class -> writeByte);
	
	_class -> writeByte(_self,b);
}
void *
cc_http_prc_class_init (void * ap_tos, void * ap_hdl)
{
  void * cc_prc = tiz_get_type (ap_hdl, "cc_prc");
  void * cc_httpprc_class = factory_new
    /* TIZ_CLASS_COMMENT: class type, class name, parent, size */
    (classOf (cc_prc), "cc_httpprc_class", classOf (cc_prc),
     sizeof (cc_http_prc_class_t),
     /* TIZ_CLASS_COMMENT: */
     ap_tos, ap_hdl,
     /* TIZ_CLASS_COMMENT: class constructor */
     ctor, cc_http_prc_class_ctor,
     /* TIZ_CLASS_COMMENT: stop value*/
     0);
  return cc_httpprc_class;
}
/**
  @fn  void close(void*_self);
  @details close the stream
*/
void close(void*_self){
  struct OutputStreamClass * _class = (struct OutputStreamClass *)classOf(_self); 
  
  assert(_class -> close);
	
	_class -> close(_self);
}
Exemple #16
0
void
show (const void *_self)
{
	const nodeclass_t *self = classOf (_self);

	assert (self->_show);
	self->_show (_self);
}
Exemple #17
0
QStringList QuickInterpreter::classesOf(QSObject &obj) const
{
    const QSClass *cls = classOf(obj);
    QStringList lst;
    for (int i = 0; i < cls->numStaticVariables(); ++i) {
	QSObject o = cls->staticMember(i);
	if (o.isA(env()->typeClass()) && QSTypeClass::classValue(&o)->asClass())
	    lst << QSTypeClass::classValue(&o)->identifier();
    }
    return lst;
}
/*
** ===================================================================
**     Method      :  BaseTiempo_constructor (bean TimeDate)
**
**     Description :
** ===================================================================
*/
void BaseTiempo_constructor(void * _self,word Year,byte Month,byte Day,byte Hour,byte Min,byte secs,bool start)
{
  struct BaseTiempo * self =(struct BaseTiempo *) _self;
  struct BaseTiempoClass * _class =(struct BaseTiempoClass *) classOf(_self);
  TmDt1_Constructor(_self,Year,Month,Day,Hour,Min,secs);
  self->configurado = FALSE;
  
  newAlloced(&self->timer,&RlxMTimer,(ulong)1000,_class->inc1Segundo,_self);
  if(!start)
    Timer_Stop(&self->timer);
}
void CompositionRemoveComponentDataCommand::redoReplayed()
{
    reflection::Expression* pCompositionExpression = phantom::expressionByName(m_strCompositionExpression);
    reflection::CompositionClass* pCompositionClass = as<reflection::CompositionClass*>(pCompositionExpression->getValueType()->removeReference()->removeConst());
    void* pComposition = pCompositionExpression->loadEffectiveAddress();
    void* pComponent = nullptr;
    pCompositionClass->get(pComposition, m_uiIndex, &pComponent);
    o_assert(pComponent);
    m_strTypeName = classOf(pComponent)->getQualifiedDecoratedName();
    pCompositionClass->remove(pComposition, m_uiIndex);
    o_dynamic_delete pCompositionExpression;
}
Exemple #20
0
static void *
node_ctor (void *_self, va_list *ap)
{
	node_t *self = super_ctor (Node, _self, ap);
	char *text = va_arg (*ap, char *);

	assert (Node == classOf (self));
	self->_data = malloc (strlen (text) + 1);
	strcpy ((char *)(self->_data), text);

	self->_next = self->_prev = (void *) 0;
	
	return self;
}
Exemple #21
0
void verifyHeap(heapPo H) {
  for (termPo t = H->start; t < H->curr;) {
    clssPo clss = classOf(t);
    if (isSpecialClass(clss)) {
      specialClassPo sClass = (specialClassPo) clss;
      t = sClass->scanFun(sClass, verifyScanHelper, H, t);
    } else {
      normalPo trm = C_TERM(t);
      labelPo lbl = C_LBL((termPo) clss);
      for (integer ix = 0; ix < labelArity(lbl); ix++) {
        validPtr(H, trm->args[ix]);
      }
      t = t + termSize(trm);
    }
  }
}
VariableWidgetEditor* ComponentVariableNodeDelegate::createEditor() const
{
    reflection::ComponentClass* pComponentClass = m_pVariableNode->getValueType()->removeConstReference()->asComponentClass();
    vector<reflection::Class*> currentClasses;
    size_t count = m_pVariableNode->getExpressionCount();
    reflection::Class* pCurrentClass = nullptr;
    for(size_t i = 0; i<count; ++i)
    {
        void* pOldValue = nullptr;
        pComponentClass->get(m_pVariableNode->getExpression(i)->loadEffectiveAddress(), &pOldValue);
        if(pOldValue)
        {
            reflection::Class* pClass = classOf(pOldValue);
            if(pCurrentClass != nullptr AND pClass != pCurrentClass)
            {
                pCurrentClass = nullptr;
                break;
            }
            pCurrentClass = pClass;
        }
    }
    return o_new(ClassComboBoxEditor)(pComponentClass->getPointedClass(), pCurrentClass, NOT(m_pVariableNode->hasModifier(o_mandatory)));
}
Exemple #23
0
// Documented in spec.
METH_IMPL_0(Value, debugString) {
    zvalue cls = classOf(ths);
    zvalue name = METH_CALL(ths, debugSymbol);
    char addrBuf[19];  // Includes room for `0x` and `\0`.

    if (name == NULL) {
        name = EMPTY_STRING;
    } else if (!typeAccepts(CLS_Symbol, name)) {
        // Suppress a non-symbol name.
        name = stringFromUtf8(-1, " (non-symbol name)");
    } else {
        name = cm_cat(stringFromUtf8(-1, " "), name);
    }

    sprintf(addrBuf, "%p", ths);

    return cm_cat(
        stringFromUtf8(-1, "@<"),
        METH_CALL(cls, debugString),
        name,
        stringFromUtf8(-1, " @ "),
        stringFromUtf8(-1, addrBuf),
        stringFromUtf8(-1, ">"));
}
string ComponentVariableNodeDelegate::valueText() const
{
    VariableModel* pVariableModel = m_pVariableNode->getVariableModel();

    reflection::ComponentClass* pComponentClass = m_pVariableNode->getValueType()->removeConstReference()->asComponentClass();
    std::set<reflection::Class*> currentClasses;
    size_t count = m_pVariableNode->getExpressionCount();
    for(size_t i = 0; i<count; ++i)
    {
        void* pOldValue = nullptr;
        pComponentClass->get(m_pVariableNode->getExpression(i)->loadEffectiveAddress(), &pOldValue);
        currentClasses.insert(classOf(pOldValue));
    }
    if(currentClasses.size() == 1)
    {
        reflection::Class* pClass = *currentClasses.begin();
        if(pClass)
        {
            return nameOf(pClass);
        }
        return "none";
    }
    return "<multiple values>";
}
UndoCommand* ComponentVariableNodeDelegate::createValueSetUndoCommand( const void* a_pValue ) const
{
    string newValueStr;
    string newValueDisplayStr;
    vector<string> newValueStrs;
    reflection::ComponentClass* pComponentClass = m_pVariableNode->getValueType()->removeConstReference()->asComponentClass();
    VariableModel* pVariableModel = m_pVariableNode->getVariableModel();
    serialization::DataBase* pDataBase = pVariableModel->getDataBase();

    UndoCommand* pGroup = o_new(phantom::qt::UndoCommand);

    void* pNewValue = *((void* const*)a_pValue);

    reflection::Class* pNewClass = nullptr;
    if(pNewValue)
    {
        pNewClass = as<reflection::Class*>(pNewValue);
        o_assert(pNewClass);
    }
    size_t count = m_pVariableNode->getExpressionCount();
    for(size_t i = 0; i<count; ++i)
    {
        phantom::data d = pVariableModel->getData()[i];
        void* pValue = nullptr;
        string tempRedoExpression;
        string redoExpression;
        string undoExpression;
        string baseExpression = m_pVariableNode->getExpression(i)->translate();
        void* pOldValue = nullptr;
        pComponentClass->get(m_pVariableNode->getExpression(i)->loadEffectiveAddress(), &pOldValue);
        if(pOldValue)
        {
            auto pOldClass = classOf(pOldValue);
            o_assert(pOldClass);
            string newInstanceExpression = "phantom::typeByName(\""+pOldClass->getQualifiedDecoratedName()+"\", phantom::rootNamespace())->newInstance()";
            undoExpression = "("+baseExpression+")=(("+pOldClass->getQualifiedDecoratedName()+"*)("+newInstanceExpression+"))";
        }
        else 
        {
            undoExpression = "("+baseExpression+")=nullptr";
        }
        if(pNewClass)
        {
            string newInstanceExpression = "phantom::typeByName(\""+pNewClass->getQualifiedDecoratedName()+"\", phantom::rootNamespace())->newInstance()";
            redoExpression = "("+baseExpression+")=(("+pNewClass->getQualifiedDecoratedName()+"*)("+newInstanceExpression+"))";
        }
        else 
        {
            redoExpression = "("+baseExpression+")=nullptr";
        }

        reflection::Expression* pRedoExpression = phantom::expressionByName(redoExpression);
        reflection::Expression* pUndoExpression = phantom::expressionByName(undoExpression);

        ExpressionCommand* pCommand = o_new(ExpressionCommand)(pDataBase, pUndoExpression, pRedoExpression);
        pCommand->setName( "In data : '"+ pDataBase->getDataAttributeValue(d, "name") + "' ("+phantom::lexical_cast<phantom::string>((void*)pDataBase->getGuid(d))+")");
        pGroup->pushCommand(pCommand);
    }

    if(pNewClass)
        pGroup->setName("Property changed : '" + m_pVariableNode->getQualifiedName()+ " = new "+phantom::qt::nameOf(pNewClass)+" component'");
    else
        pGroup->setName("Property changed : '" + m_pVariableNode->getQualifiedName()+ " = none'");

    return pGroup;
}