本文整理汇总了C++中owner函数的典型用法代码示例。如果您正苦于以下问题:C++ owner函数的具体用法?C++ owner怎么用?C++ owner使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了owner函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: most_urgent_DataUnit
// ----------------------------------------------------------------------
autocast::AutoCastProcessor::LocalDataUnit *
AutoCastProcessor::
most_urgent_DataUnit()
throw()
{
double now = owner().world().scheduler().current_time();
std::vector<LocalDataUnit*> tmp_objects;
for (DataUnitsMap::const_iterator it = complete_DataUnits_.begin(); it != complete_DataUnits_.end(); ++it){
if (it->second->last_send_time() < now && it->second->unknown_count() > 0){
for (int i = 0; i < it->second->unknown_count(); i++){
tmp_objects.push_back(it->second);
}
}
}
if (tmp_objects.size() == 0) return NULL;
int idx = static_cast<int>(uniform_random(0.0,tmp_objects.size(),true,false));
return tmp_objects.at(idx);
}
开发者ID:MarcStelzner,项目名称:shawn,代码行数:21,代码来源:autocast_processor.cpp
示例2: fabs
void CMissileProjectile::Collision()
{
const float h = ground->GetHeightReal(pos.x, pos.z);
if (weaponDef->waterweapon && h < pos.y) {
// let waterweapons travel in water
return;
}
if (h > pos.y && fabs(speed.y) > 0.001f) {
pos -= speed * std::min(1.0f, (float)((h - pos.y) / fabs(speed.y)));
}
if (weaponDef->visuals.smokeTrail) {
new CSmokeTrailProjectile(pos, oldSmoke, dir, oldDir, owner(), false, true, 7, SMOKE_TIME, 0.6f, drawTrail, 0, weaponDef->visuals.texture2);
}
CWeaponProjectile::Collision();
oldSmoke = pos;
}
开发者ID:BrainDamage,项目名称:spring,代码行数:20,代码来源:MissileProjectile.cpp
示例3: PolyAlgebraHom
RingHom PolyAlgebraHom(const PolyRing& Rx, const ring& Ry, const std::vector<RingElem>& IndetImages)
{
const char* const FnName = "PolyAlgebraHom(Rx,Ry,IndetImages)";
// Check that IndetImages are sensible...
if (NumIndets(Rx) != len(IndetImages))
CoCoA_ERROR(ERR::BadPolyRingHomImages, FnName);
for (long i=0; i < NumIndets(Rx); ++i)
if (owner(IndetImages[i]) != Ry)
CoCoA_ERROR(ERR::BadPolyRingHomImages, FnName);
// // Special case: codomain is coeff ring.
// if (Ry == CoeffRing(Rx))
// return Rx->myHomCtor(Ry, IdentityHom(Ry), IndetImages);
// // General case: codomain must be a poly ring with same coeffs
// if (!IsPolyRing(Ry))
// CoCoA_ERROR(ERR::BadCodomain, FnName);
// if (CoeffRing(Rx) != CoeffRing(Ry))
// CoCoA_ERROR(ERR::MixedCoeffRings, FnName);
// return Rx->myHomCtor(Ry, CoeffEmbeddingHom(Ry), IndetImages);
return Rx->myHomCtor(Ry, CanonicalHom(CoeffRing(Rx),Ry), IndetImages);
}
开发者ID:BrentBaccala,项目名称:CoCoA,代码行数:20,代码来源:PolyRing.C
示例4: owner
void CWeaponProjectile::Collision()
{
if (/* !weaponDef->noExplode || gs->frameNum & 1 */ true) {
// don't do damage only on odd-numbered frames
// for noExplode projectiles (it breaks coldet)
float3 impactDir = speed;
impactDir.Normalize();
// Dynamic Damage
DamageArray dynDamages;
if (weaponDef->dynDamageExp > 0)
dynDamages = weaponDefHandler->DynamicDamages(weaponDef->damages,
startpos, pos, (weaponDef->dynDamageRange > 0)
? weaponDef->dynDamageRange
: weaponDef->range,
weaponDef->dynDamageExp, weaponDef->dynDamageMin,
weaponDef->dynDamageInverted);
helper->Explosion(pos,
(weaponDef->dynDamageExp > 0) ? dynDamages : weaponDef->damages,
weaponDef->areaOfEffect, weaponDef->edgeEffectiveness,
weaponDef->explosionSpeed, owner(), true,
weaponDef->noExplode ? 0.3f : 1,
weaponDef->noExplode || weaponDef->noSelfDamage, weaponDef->impactOnly,
weaponDef->explosionGenerator, 0, impactDir, weaponDef->id);
}
if (weaponDef->soundhit.getID(0) > 0) {
Channels::Battle.PlaySample(weaponDef->soundhit.getID(0), this,
weaponDef->soundhit.getVolume(0));
}
if (!weaponDef->noExplode){
CProjectile::Collision();
} else {
if (TraveledRange()) {
CProjectile::Collision();
}
}
}
开发者ID:Gepard,项目名称:spring,代码行数:41,代码来源:WeaponProjectile.cpp
示例5: owner
::CORBA::Boolean
TestValuetype::_tao_unmarshal (
TAO_InputCDR &strm,
TestValuetype *&new_object
)
{
::CORBA::ValueBase *base = 0;
::CORBA::Boolean is_indirected = false;
::CORBA::Boolean is_null_object = false;
::CORBA::Boolean const retval =
::CORBA::ValueBase::_tao_unmarshal_pre (
strm,
base,
TestValuetype::_tao_obv_static_repository_id (),
is_null_object,
is_indirected
);
::CORBA::ValueBase_var owner (base);
if (!retval)
return false;
if (is_null_object)
return true;
if (!is_indirected && !base->_tao_unmarshal_v (strm))
return false;
// Now base must point to the unmarshaled object.
// Align the pointer to the right subobject.
new_object = TestValuetype::_downcast (base);
if (0 == new_object)
return false;
if (is_indirected)
new_object->_add_ref ();
owner._retn ();
return true;
}
开发者ID:esohns,项目名称:ATCD,代码行数:41,代码来源:testC.cpp
示例6: creator
void permission_object_t::test<5>()
{
LLPermissions perm,perm1;
LLUUID creator("abf0d56b-82e5-47a2-a8ad-74741bb2c29e");
LLUUID owner("68edcf47-ccd7-45b8-9f90-1649d7f12806");
LLUUID lastOwner("5e47a0dc-97bf-44e0-8b40-de06718cee9d");
LLUUID group("9c8eca51-53d5-42a7-bb58-cef070395db8");
perm1.init(creator,owner,lastOwner,group);
U32 base = PERM_TRANSFER;
U32 ownerp = PERM_TRANSFER;
U32 groupp = PERM_TRANSFER;
U32 everyone = PERM_TRANSFER;
U32 next = PERM_NONE;
perm1.initMasks(base, ownerp, everyone, groupp, next);
base = PERM_ALL;
ownerp = PERM_ITEM_UNRESTRICTED; //PERM_ITEM_UNRESTRICTED = PERM_MODIFY | PERM_COPY | PERM_TRANSFER;
groupp = PERM_TRANSFER | PERM_COPY|PERM_MODIFY;
everyone = PERM_TRANSFER;
next = PERM_NONE;
perm.init(creator,owner,lastOwner,group);
perm.initMasks(base, ownerp, everyone, groupp, next);
// restrict permissions by accumulation
perm.accumulate(perm1);
U32 fixedbase = PERM_TRANSFER | PERM_MOVE;
U32 fixedowner = PERM_TRANSFER;
U32 fixedgroup = PERM_TRANSFER;
U32 fixedeveryone = PERM_TRANSFER;
U32 fixednext = PERM_NONE;
ensure_equals("accumulate failed ", fixedbase, perm.getMaskBase());
ensure_equals("accumulate failed ", fixedowner, perm.getMaskOwner());
ensure_equals("accumulate failed ", fixedgroup, perm.getMaskGroup());
ensure_equals("accumulate failed ", fixedeveryone, perm.getMaskEveryone());
ensure_equals("accumulate failed ", fixednext, perm.getMaskNextOwner());
}
开发者ID:9skunks,项目名称:imprudence,代码行数:41,代码来源:llpermissions_tut.cpp
示例7: utime
/*
****************************************************************
* Chamada ao sistema "utime" *
****************************************************************
*/
int
utime (const char *path, const time_t *tp)
{
register INODE *ip;
time_t tv[3];
if ((ip = owner (path)) == NOINODE)
return (-1);
if (ip->i_sb->sb_mntent.me_flags & SB_RONLY)
{ u.u_error = EROFS; goto bad; }
/*
* Altera os tempos
*/
if (tp == (time_t *)NULL) /* Tempos de acesso e modificação */
{
ip->i_atime = time;
ip->i_mtime = time;
}
else /* Os 3 tempos */
{
if (unimove (tv, tp, sizeof (tv), US))
{
u.u_error = EFAULT;
goto bad;
}
ip->i_atime = tv[0];
ip->i_mtime = tv[1];
ip->i_ctime = tv[2];
}
inode_dirty_inc (ip);
bad:
iput (ip);
return (UNDEF);
} /* end utime */
开发者ID:marioaugustorama,项目名称:tropix-kernel,代码行数:46,代码来源:systime.c
示例8: work
// ----------------------------------------------------------------------
void
LocalizationIterLaterationModule::
work( void )
throw()
{
if ( state_ == il_finished )
return;
// do initial stuff;
// if anchor, send 'init-message' and set state to 'finished';
// if unknown, check whether the node is sound or not. if sound,
// send messages, if not, clear estimated position.
if ( state_ == il_init )
{
if ( owner().is_anchor() )
{
send( new LocalizationIterLaterationMessage( observer().confidence() ) );
state_ = il_finished;
}
else
{
sound_ = neighborhood().is_sound();
if ( sound_ && node().has_est_position() )
{
send( new LocalizationIterLaterationMessage( observer().confidence() ) );
send( new LocalizationIterLaterationSoundMessage() );
}
else
{
set_confidence( 0 );
node_w().clear_est_position();
}
state_ = il_work;
}
}
if ( state_ == il_work )
iter_lateration_step();
}
开发者ID:MarcStelzner,项目名称:shawn,代码行数:42,代码来源:localization_iter_lateration_module.cpp
示例9: t01_basic
void t01_basic(){
INIT_LOCAL();
Onion::Dict normal;
normal.add("Hello", "World");
onion_dict *d=onion_dict_new();
onion_dict_add(d, "Hello", "2", 0);
Onion::Dict non_owner(d);
FAIL_IF_NOT_EQUAL_STRING(non_owner.get("Hello"), "2");
Onion::Dict owner(d, true);
FAIL_IF_NOT_EQUAL_STRING(owner.get("Hello"), "2");
non_owner.add("non-owner", "true");
FAIL_IF_NOT_EQUAL_STRING(owner.get("non-owner"), "true");
FAIL_IF_NOT_EQUAL_STRING(onion_dict_get(d,"non-owner"), "true");
END_LOCAL();
}
开发者ID:andrew-aladev,项目名称:onion,代码行数:21,代码来源:02-dict.cpp
示例10: loader
bool GScriptCoreService::loadLibrary(const char * namespaces, const GMetaVariadicParam * libraryNames)
{
if(! this->libraryLoader) {
GScopedInterface<IScriptLibraryLoader> loader(createBuiltinLibraries(this->scriptObject));
this->libraryLoader.reset(loader.get());
}
if(namespaces == NULL) {
namespaces = this->bindName.c_str();
}
GScopedInterface<IScriptObject> owner(scriptObjectToInterface(this->scriptObject, false));
for(size_t i = 0; i < libraryNames->paramCount; ++i) {
char * name = fromVariant<char *>(*(libraryNames->params[i]));
if(! this->libraryLoader->loadScriptLibrary(owner.get(), namespaces, name)) {
return false;
}
}
return true;
}
开发者ID:Remscar,项目名称:cpgf,代码行数:21,代码来源:gscriptservice.cpp
示例11: owner
/*--------------------------------------------------
* Center the window concerning his owner window
*--------------------------------------------------*/
PMWindow& PMWindow::center_at()
{
HWND o_handle = owner ();
HWND p_handle = parent ();
SHAPE o_shape = PMWindow( o_handle ? o_handle : p_handle ).shape();
SHAPE shape = this->shape();
if( o_handle )
{
shape.x = (o_shape.cx - shape.cx)/2 + o_shape.x;
shape.y = (o_shape.cy - shape.cy)/2 + o_shape.y;
}
else
{
shape.x = (o_shape.cx - shape.cx)/2;
shape.y = (o_shape.cy - shape.cy)/2;
}
return reshape( shape );
}
开发者ID:OS2World,项目名称:UTIL-INTERNATIONAL-Characters-Map-2,代码行数:24,代码来源:pm_window.cpp
示例12: machine
void cpc_symbiface2_device::device_start()
{
device_t* cpu = machine().device("maincpu");
address_space& space = cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
space.install_readwrite_handler(0xfd00,0xfd07,read8_delegate(FUNC(cpc_symbiface2_device::ide_cs1_r),this),write8_delegate(FUNC(cpc_symbiface2_device::ide_cs1_w),this));
space.install_readwrite_handler(0xfd08,0xfd0f,read8_delegate(FUNC(cpc_symbiface2_device::ide_cs0_r),this),write8_delegate(FUNC(cpc_symbiface2_device::ide_cs0_w),this));
space.install_read_handler(0xfd10,0xfd10,read8_delegate(FUNC(cpc_symbiface2_device::mouse_r),this));
space.install_readwrite_handler(0xfd14,0xfd15,read8_delegate(FUNC(cpc_symbiface2_device::rtc_r),this),write8_delegate(FUNC(cpc_symbiface2_device::rtc_w),this));
space.install_readwrite_handler(0xfd17,0xfd17,read8_delegate(FUNC(cpc_symbiface2_device::rom_rewrite_r),this),write8_delegate(FUNC(cpc_symbiface2_device::rom_rewrite_w),this));
// set up ROM space (these can be writable, when mapped to &4000, or completely disabled, allowing the built-in ROMs to be visible)
// 32 banks of 16kB (512kB)
m_rom_space.resize(32*16384);
m_nvram->set_base(&m_rom_space[0],m_rom_space.size());
save_item(NAME(m_rom_space));
}
开发者ID:Enverex,项目名称:mame,代码行数:21,代码来源:symbfac2.cpp
示例13: getRoot
/// Closes the LocalConnection object.
//
/// This removes the advanceCallback (so we can be removed by the GC) and
/// removes this object as a listener from the shared memory listeners
/// section.
void
LocalConnection_as::close()
{
// We may be waiting either to send or to receive, so in both cases
// make sure update() isn't called again.
movie_root& mr = getRoot(owner());
mr.removeAdvanceCallback(this);
if (!_connected) return;
_connected = false;
SharedMem::Lock lock(_shm);
if (!lock.locked()) {
log_error("Failed to get lock on shared memory! Will not remove "
"listener");
return;
}
removeListener(_domain + ":" + _name, _shm);
}
开发者ID:diocles,项目名称:gnash,代码行数:26,代码来源:LocalConnection_as.cpp
示例14: fatalerror
void msx_slot_bunsetsu_device::device_start()
{
msx_slot_rom_device::device_start();
if (m_bunsetsu_region_tag == nullptr)
{
fatalerror("msx_slot_bunsetsu_device: no bunsetsu region tag specified\n");
}
m_bunsetsu_region = owner()->memregion(m_bunsetsu_region_tag);
if (m_bunsetsu_region == nullptr)
{
fatalerror("msx_slot_bunsetsu_device: Unable to find region with tag '%s'\n", m_bunsetsu_region_tag);
}
if (m_bunsetsu_region->bytes() != 0x20000)
{
fatalerror("msx_slot_bunsetsu_device: Bunsetsu region must be 0x20000 bytes.\n");
}
}
开发者ID:BenjaminSiskoo,项目名称:mame,代码行数:21,代码来源:bunsetsu.cpp
示例15: owner
cell factor_vm::code_block_owner(code_block *compiled)
{
tagged<object> owner(compiled->owner);
/* Cold generic word call sites point to quotations that call the
inline-cache-miss and inline-cache-miss-tail primitives. */
if(owner.type_p(QUOTATION_TYPE))
{
tagged<quotation> quot(owner.as<quotation>());
tagged<array> elements(quot->array);
#ifdef FACTOR_DEBUG
assert(array_capacity(elements.untagged()) == 5);
assert(array_nth(elements.untagged(),4) == special_objects[PIC_MISS_WORD]
|| array_nth(elements.untagged(),4) == special_objects[PIC_MISS_TAIL_WORD]);
#endif
tagged<wrapper> word_wrapper(array_nth(elements.untagged(),0));
return word_wrapper->object;
}
else
return compiled->owner;
}
开发者ID:inforichland,项目名称:factor-id3,代码行数:21,代码来源:code_blocks.cpp
示例16: widgets
void ScroolWidget::ProxyLayout::applyLayout() {
int sw = widgets().size()*spacing(),
sh = sw;
for( size_t i=0; i<widgets().size(); ++i ){
Tempest::Size s = sizeHint( widgets()[i] );
sw += s.w;
sh += s.h;
}
Widget* sbox = owner()->owner();
Tempest::Size sback, stop;
if( widgets().size() ){
sback = sizeHint( widgets().back() );
stop = sizeHint( widgets()[0] );
}
if( orientation()==Tempest::Vertical ){
int sscroll = 0;
if( scroolBeforeBegin )
sscroll = -std::max(sbox->h()-stop.h, stop.h);
if( scroolAfterEnd )
scrool->setRange( sscroll, sh-std::min( sback.h, sbox->h()) ); else
scrool->setRange( sscroll, sh-scrool->h() );
owner()->setPosition( 0, -scrool->value() );
owner()->resize( owner()->w(), sh );
} else {
int sscroll = 0;
if( scroolBeforeBegin )
sscroll = -std::max(sbox->w()-stop.w, stop.w);
if( scroolAfterEnd )
scrool->setRange( sscroll, sw-std::min(sback.w, sbox->w()));else
scrool->setRange( sscroll, sw-scrool->w() );
owner()->setPosition( -scrool->value(), 0 );
owner()->resize( sw, owner()->h());
}
LinearLayout::applyLayout();
}
开发者ID:Try,项目名称:game,代码行数:43,代码来源:scroolwidget.cpp
示例17: code
/* Might GC */
code_block *factor_vm::add_code_block(code_block_type type, cell code_, cell labels_, cell owner_, cell relocation_, cell parameters_, cell literals_)
{
data_root<byte_array> code(code_,this);
data_root<object> labels(labels_,this);
data_root<object> owner(owner_,this);
data_root<byte_array> relocation(relocation_,this);
data_root<array> parameters(parameters_,this);
data_root<array> literals(literals_,this);
cell code_length = array_capacity(code.untagged());
code_block *compiled = allot_code_block(code_length,type);
compiled->owner = owner.value();
/* slight space optimization */
if(relocation.type() == BYTE_ARRAY_TYPE && array_capacity(relocation.untagged()) == 0)
compiled->relocation = false_object;
else
compiled->relocation = relocation.value();
if(parameters.type() == ARRAY_TYPE && array_capacity(parameters.untagged()) == 0)
compiled->parameters = false_object;
else
compiled->parameters = parameters.value();
/* code */
memcpy(compiled + 1,code.untagged() + 1,code_length);
/* fixup labels */
if(to_boolean(labels.value()))
fixup_labels(labels.as<array>().untagged(),compiled);
/* next time we do a minor GC, we have to scan the code heap for
literals */
this->code->write_barrier(compiled);
this->code->uninitialized_blocks.insert(std::make_pair(compiled,literals.value()));
return compiled;
}
开发者ID:inforichland,项目名称:factor-id3,代码行数:40,代码来源:code_blocks.cpp
示例18: clear_sars
void adc083x_device::device_start()
{
clear_sars();
/* resolve callbacks */
m_input_callback.bind_relative_to(*owner());
/* register for state saving */
save_item( NAME(m_cs) );
save_item( NAME(m_clk) );
save_item( NAME(m_di) );
save_item( NAME(m_se) );
save_item( NAME(m_sars) );
save_item( NAME(m_do) );
save_item( NAME(m_sgl) );
save_item( NAME(m_odd) );
save_item( NAME(m_sel1) );
save_item( NAME(m_sel0) );
save_item( NAME(m_state) );
save_item( NAME(m_bit) );
save_item( NAME(m_output) );
}
开发者ID:Tauwasser,项目名称:mame,代码行数:22,代码来源:adc083x.cpp
示例19: process_message
// ----------------------------------------------------------------------
bool
VisEnergyProcessor::
process_message( const ConstMessageHandle& mh )
throw()
{
const helloworld::HelloworldMessage* hmsg =
dynamic_cast<const helloworld::HelloworldMessage*>
( mh.get() );
if( hmsg != NULL )
{
last_time_of_receive_=simulation_round();
neighbours_.insert( &hmsg->source() );
cout << "ID '" << owner().label() << "' GOT HELLO FROM '"
<< hmsg->source().label() << "'" << endl;
this->owner_w().remove_tag_by_name("VisBattery");
this->owner_w().add_tag(new shawn::DoubleTag("VisBattery", 0.0));
return true;
}
this->owner_w().remove_tag_by_name("VisBattery");
this->owner_w().add_tag(new shawn::DoubleTag("VisBattery", 0.0));
return Processor::process_message( mh );
}
开发者ID:MarcStelzner,项目名称:shawn,代码行数:23,代码来源:vis_energy_processor.cpp
示例20: send_to
// ----------------------------------------------------------------------
bool
AutoCastProcessor::
send_to(const ConstDataUnitHandle& duh, shawn::Processor* creator)
throw()
{
if (state() != Processor::Active) return false;
LocalDataUnit* ldu = NULL;
bool is_new = false;
/// Not interested in if is a new DataUnit and disable logging
ldu = handle_DataUnit(duh, is_new, false);
if (ldu != NULL){
ldu->creator(creator);
if (creator) ldu->refresh_before_send(true);
int unknown_count = owner().world().simulation_controller().environment().optional_int_param("_unknown_count__send",10);
ldu->unknown_count(unknown_count);
update();
return true;
}
return false;
}
开发者ID:MarcStelzner,项目名称:shawn,代码行数:23,代码来源:autocast_processor.cpp
注:本文中的owner函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论