Exemple #1
0
  Object* Class::set_superclass(STATE, Object* obj) {
    if(obj->nil_p()) {
      superclass(state, nil<Class>());
      return cNil;
    }

    Class* sup;
    if((sup = try_as<Class>(obj)) == 0) {
      return Primitives::failure();
    }

    if(try_as<SingletonClass>(sup)) {
      Exception::type_error(state, "cannot inherit from a singleton class");
    }

    superclass(state, sup);

    instance_type(state, sup->instance_type());
    if(sup->type_info()->type == PackedObject::type) {
      set_type_info(state->memory()->type_info[ObjectType]);
    } else {
      set_type_info(sup->type_info());
    }

    SingletonClass::attach(state, this, sup->singleton_class(state));

    return cNil;
  }
Exemple #2
0
        device::instance_type
        device::cb_set_instance(instance_type const&)
        {
          TRACE("hugh::render::vulkan::context::device::cb_set_instance");
          
          throw std::logic_error("invalid operation "
                                 "'hugh::render::vulkan::context::device::cb_set_instance'");

          return instance_type();
        }
void Profile::start_receiver_instance(string id, string name, int N, string pubdata_b64, string private_key_b64) {
    
    instance_types stored_type = instance_type(id);
    
    // Return if instance is already loaded as a sender, or as a receiver
    if (stored_type == BROADMASK_INSTANCE_BM_BE_SENDER || stored_type == BROADMASK_INSTANCE_BM_BE)
        return;
    
    // decode params
    string public_params = base64_decode(pubdata_b64);
    string private_key = base64_decode(private_key_b64);
    
    // Create and store instance
    BM_BE *instance = new BM_BE(id, N, public_params, private_key);  
    add_receiver_instance(instance);
}
Exemple #4
0
  Object* Class::set_superclass(STATE, Object* obj) {
    if(obj->nil_p()) {
      superclass(state, (Class*)Qnil);
      return Qnil;
    }

    Class* sup;
    if((sup = try_as<Class>(obj)) == 0) {
      return Primitives::failure();
    }

    superclass(state, sup);

    instance_type(state, sup->instance_type());
    set_type_info(sup->type_info());

    packed_ivar_info(state, sup->packed_ivar_info());
    set_packed_size(sup->packed_size());

    MetaClass::attach(state, this, sup->metaclass(state));

    return Qnil;
  }
Exemple #5
0
 static set_return_type set( input_type container, component_input_const_type value )
 {
     //TODO C++14 static_assert( index <  length, "Index out of range." );
     container = ( container & ~(  this_type::mask() << ( index * width ) ) )  |  ( ( instance_type(value) ) << ( index * width ) );
 }
Exemple #6
0
 static set_return_type set( input_type container, index_input_const_type index, component_input_const_type value )
 {
     container = ( container & ~(  this_type::mask() << ( index * width ) ) )  |  ( ( instance_type(value) << ( index * width ) ) );
 }
Exemple #7
0
 void Class::set_object_type(STATE, size_t type) {
   instance_type(state, Fixnum::from(type));
   type_info_ = state->om->type_info[type];
 }
Exemple #8
0
 void Class::set_object_type(STATE, size_t type) {
   instance_type(state, Fixnum::from(type));
   type_info(state->memory()->type_info[type]);
 }