本文整理汇总了C++中ACE_Auto_Ptr::exists方法的典型用法代码示例。如果您正苦于以下问题:C++ ACE_Auto_Ptr::exists方法的具体用法?C++ ACE_Auto_Ptr::exists怎么用?C++ ACE_Auto_Ptr::exists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ACE_Auto_Ptr
的用法示例。
在下文中一共展示了ACE_Auto_Ptr::exists方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fg
TAO::PG_Group_List_Store::PG_Group_List_Store (
Storable_Factory & storable_factory)
: next_group_id_ (0)
, storable_factory_ (storable_factory)
, loaded_from_stream_ (false)
, last_changed_ (0)
, stale_ (false)
{
// Create a temporary stream simply to check if a readable
// version already exists.
bool stream_exists = false;
{
ACE_Auto_Ptr<TAO::Storable_Base> stream (
this->create_stream ("r"));
if (stream->exists ())
stream_exists = true;
}
if (stream_exists)
{
File_Guard fg(*this, SFG::CREATE_WITH_FILE);
}
else
{
File_Guard fg(*this, SFG::CREATE_WITHOUT_FILE);
this->write (fg.peer ());
}
}
示例2: fg
Savable::Savable (TAO::Storable_Factory & storable_factory)
: storable_factory_(storable_factory)
, loaded_from_stream_ (false)
{
for (int index = 0; index < 2; ++index)
{
this->i_[index] = 0;
this->ui_[index] = 0;
this->bytes_size_[index] = 0;
this->bytes_[index] = new char [this->bytes_size_max];
for (int i = 0; i < this->bytes_size_max; ++i)
{
this->bytes_[index][i] = ACE_CHAR_MAX;
}
}
ACE_Auto_Ptr<TAO::Storable_Base>
stream (storable_factory_.create_stream("test.dat", "r"));
if (stream->exists ())
{
Savable_File_Guard fg(*this, SFG::CREATE_WITH_FILE);
}
else
{
Savable_File_Guard fg(*this, SFG::CREATE_WITHOUT_FILE);
this->write (fg.peer ());
}
}
示例3: INTERNAL
bool
TAO::PG_Group_List_Store::list_obsolete ()
{
// TODO: Upate if obsolete flag is set based on CORBA call.
ACE_Auto_Ptr<TAO::Storable_Base> stream (this->create_stream ("r"));
if (!stream->exists ())
throw CORBA::INTERNAL ();
if (stream->open () != 0)
throw CORBA::INTERNAL ();
return this->is_obsolete (stream->last_changed ());
}
示例4: stream
TAO::PG_Object_Group_Storable::~PG_Object_Group_Storable (void)
{
if (destroyed_)
{
ACE_Auto_Ptr<TAO::Storable_Base> stream (
this->create_stream ("r"));
if (stream->exists ())
{
stream->remove ();
}
}
}
示例5: fg
TAO::PG_Object_Group_Storable::PG_Object_Group_Storable (
CORBA::ORB_ptr orb,
PortableGroup::FactoryRegistry_ptr factory_registry,
TAO::PG_Object_Group_Manipulator & manipulator,
CORBA::Object_ptr empty_group,
const PortableGroup::TagGroupTaggedComponent & tagged_component,
const char * type_id,
const PortableGroup::Criteria & the_criteria,
const TAO::PG_Property_Set_var & type_properties,
TAO::Storable_Factory & storable_factory)
: PG_Object_Group(orb,
factory_registry,
manipulator,
empty_group,
tagged_component,
type_id,
the_criteria,
type_properties)
, group_previously_stored_(false)
, group_id_previously_stored_(0)
, storable_factory_ (storable_factory)
, last_changed_ (0)
, loaded_from_stream_ (false)
, destroyed_ (false)
, write_occurred_ (false)
{
// Create a temporary stream simply to check if a readable
// version already exists.
bool stream_exists = false;
{
ACE_Auto_Ptr<TAO::Storable_Base> stream (
this->create_stream ("r"));
if (stream->exists ())
stream_exists = true;
}
if (stream_exists)
{
Object_Group_File_Guard fg (*this, SFG::CREATE_WITH_FILE);
}
else
{
Object_Group_File_Guard fg (*this, SFG::CREATE_WITHOUT_FILE);
this->write (fg.peer ());
}
}