本文整理汇总了C++中remove_reference函数的典型用法代码示例。如果您正苦于以下问题:C++ remove_reference函数的具体用法?C++ remove_reference怎么用?C++ remove_reference使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove_reference函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: modulus
expression modulus(
const std::shared_ptr< llvm::LLVMContext > &context,
const std::shared_ptr< ir_builder_t > &ir_builder,
const expression &left_expr,
const expression &right_expr
) {
const expression left = remove_reference( context, ir_builder, left_expr );
const expression right = remove_reference( context, ir_builder, right_expr );
return apply_visitor( node::modulus( context, ir_builder, left, right ), left.type(), right.type() );
}
示例2: const_cast_
expression const_cast_(
const std::shared_ptr< llvm::LLVMContext > &context,
const std::shared_ptr< ir_builder_t > &ir_builder,
const type cast_to,
const expression &value
) {
if(
type_traits::is_reference( value.type() ) ||
type_traits::is_pointer( value.type() )
) {
if(
value.type().which() == cast_to.which()
) return remove_const_cast( context, ir_builder, cast_to, value );
else if(
type_traits::is_reference( value.type() ) &&
type_traits::is_pointer( cast_to )
) {
const auto dereferenced = remove_reference( context, ir_builder, value );
return const_cast_( context, ir_builder, cast_to, dereferenced );
}
else if(
type_traits::is_rvalue_reference( value.type() ) &&
type_traits::is_lvalue_reference( cast_to )
) return reference_cast( context, ir_builder, cast_to, value );
}
throw exceptions::invalid_cast();
}
示例3: remove_reference
int RealmSocket::open(void * arg)
{
ACE_INET_Addr addr;
if (peer().get_remote_addr(addr) == -1)
{
sLog->outError(LOG_FILTER_AUTHSERVER, "Error %s while opening realm socket!", ACE_OS::strerror(errno));
return -1;
}
_remoteAddress = addr.get_host_addr();
_remotePort = addr.get_port_number();
// Register with ACE Reactor
if (Base::open(arg) == -1)
return -1;
if (session_)
session_->OnAccept();
// reactor takes care of the socket from now on
remove_reference();
return 0;
}
示例4: remove_reference
void BitVector::set_to_ones(void)
{
_has_count = true;
_count = 0;
remove_reference(_block);
_block = _ones_block;
add_reference(_block);
}
示例5: ACE_UNUSED_ARG
int WorldSocket::open (void *a)
{
ACE_UNUSED_ARG (a);
// Prevent double call to this func.
if (m_OutBuffer)
return -1;
// This will also prevent the socket from being Updated
// while we are initializing it.
m_OutActive = true;
// Hook for the manager.
if (sWorldSocketMgr->OnSocketOpen(this) == -1)
return -1;
// Allocate the buffer.
ACE_NEW_RETURN (m_OutBuffer, ACE_Message_Block (m_OutBufferSize), -1);
// Store peer address.
ACE_INET_Addr remote_addr;
if (peer().get_remote_addr(remote_addr) == -1)
{
sLog->outError("WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
return -1;
}
m_Address = remote_addr.get_host_addr();
// Send startup packet.
WorldPacket packet (SMSG_AUTH_CHALLENGE, 24);
packet << uint32(1); // 1...31
packet << m_Seed;
BigNumber seed1;
seed1.SetRand(16 * 8);
packet.append(seed1.AsByteArray(16), 16); // new encryption seeds
BigNumber seed2;
seed2.SetRand(16 * 8);
packet.append(seed2.AsByteArray(16), 16); // new encryption seeds
if (SendPacket(packet) == -1)
return -1;
// Register with ACE Reactor
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
{
sLog->outError("WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
return -1;
}
// reactor takes care of the socket from now on
remove_reference();
return 0;
}
示例6: shutdown
int RealmSocket::close(int) {
shutdown();
closing_ = true;
remove_reference();
return 0;
}
示例7: shutdown
int WorldSocket::close (u_long)
{
shutdown();
closing_ = true;
remove_reference();
return 0;
}
示例8: DEBUG_LOG
int RASocket::close(int)
{
if(closing_)
return -1;
DEBUG_LOG("RASocket::close");
shutdown();
closing_ = true;
remove_reference();
return 0;
}
示例9: suif_assert
void BitVector::read(const char *location)
{
_has_count = false;
_count = 0;
const char *follow = location;
suif_assert((*follow == '0') && (follow[1] == 'x'));
follow += 2;
bool sign_extend = (*follow == '.');
while (*follow == '.')
++follow;
const char *end = follow;
while (*end != 0)
++end;
suif_assert(end > follow);
remove_reference(_block);
size_t hex_digits_per_word = sizeof(BitVector::ChunkT) * 2;
bool infinity_is_one =
(sign_extend ? ((*follow > '7') || (*follow < '0')) : false);
size_t word_count =
((end - follow) + hex_digits_per_word - 1) / hex_digits_per_word;
_block = new BitVectorBlock(word_count, infinity_is_one, word_count);
size_t word_num = word_count;
if (((end - follow) % hex_digits_per_word) > 0)
{
BitVector::ChunkT high_word = (infinity_is_one ? ~0lu : 0lu);
while (((end - follow) % hex_digits_per_word) > 0)
{
unsigned char new_half_byte = convert_from_hex(*follow);
suif_assert(new_half_byte != 16);
high_word = (high_word << 4) | new_half_byte;
++follow;
}
--word_num;
_block->_data[word_num] = high_word;
}
while (follow < end)
{
BitVector::ChunkT this_word = 0;
for (size_t digit_num = 0; digit_num < hex_digits_per_word;
++digit_num)
{
unsigned char new_half_byte = convert_from_hex(*follow);
suif_assert(new_half_byte != 16);
this_word = (this_word << 4) | new_half_byte;
++follow;
}
--word_num;
_block->_data[word_num] = this_word;
}
assert(follow == end);
assert(word_num == 0);
_block->unpad();
}
示例10: release_notifier_domain
void release_notifier_domain(domain_maintainer_t *dm, notifier_domain_t *domain)
{
if ((!dm) || (!domain)) return;
cds_mutex_lock(&dm->mutex);
if (remove_reference(&domain->ref)) {
/* last reference */
DEBUG_LOG("freeing domain: \'%.*s\'\n", FMT_STR(domain->name));
remove_notifier_domain(dm, domain);
destroy_notifier_domain(domain);
}
cds_mutex_unlock(&dm->mutex);
}
示例11: c_style_cast
expression c_style_cast(
const std::shared_ptr< llvm::LLVMContext > &context,
const std::shared_ptr< ir_builder_t > &ir_builder,
const type cast_to,
const expression &value
) {
if(
( type_traits::is_reference( value.type() ) ||
type_traits::is_pointer( value.type() ) ) &&
( type_traits::is_reference( cast_to ) ||
type_traits::is_pointer( cast_to ) )
) return type_only_cast( context, ir_builder, cast_to, value );
else if(
type_traits::is_pointer( value.type() ) ||
type_traits::is_promotable( cast_to )
) return address_cast( context, ir_builder, cast_to, value );
else if(
type_traits::is_promotable( value.type() ) ||
type_traits::is_pointer( cast_to )
) return address_cast( context, ir_builder, cast_to, value );
else if(
type_traits::is_arithmetic( value.type() ) &&
type_traits::is_arithmetic( cast_to )
) return arithmetic_cast( context, ir_builder, cast_to, value );
else if(
value.type().which() == cast_to.which()
) {
if(
type_traits::is_reference( value.type() ) ||
type_traits::is_pointer( value.type() )
) return native_cast( context, ir_builder, cast_to, value );
else return remove_const_cast( context, ir_builder, cast_to, value );
}
else if(
type_traits::is_reference( value.type() )
) {
if( type_traits::is_arithmetic( cast_to ) ||
type_traits::is_aggregated( cast_to )
) {
const auto dereferenced = remove_reference( context, ir_builder, value );
return c_style_cast( context, ir_builder, cast_to, dereferenced );
}
else if( type_traits::is_lvalue_reference( cast_to ) ) {
return reference_cast( context, ir_builder, cast_to, value );
}
}
else if( type_traits::is_array( value.type() ) ) {
return array_cast( context, ir_builder, cast_to, value );
}
throw exceptions::invalid_cast();
}
示例12: ACE_UNUSED_ARG
int WorldSocket::open (void *a)
{
ACE_UNUSED_ARG (a);
// Prevent double call to this func.
if (m_OutBuffer)
return -1;
// This will also prevent the socket from being Updated
// while we are initializing it.
m_OutActive = true;
// Hook for the manager.
if (sWorldSocketMgr->OnSocketOpen(this) == -1)
return -1;
// Allocate the buffer.
ACE_NEW_RETURN (m_OutBuffer, ACE_Message_Block (m_OutBufferSize), -1);
// Store peer address.
ACE_INET_Addr remote_addr;
if (peer().get_remote_addr(remote_addr) == -1)
{
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: peer().get_remote_addr errno = %s", ACE_OS::strerror (errno));
return -1;
}
m_Address = remote_addr.get_host_addr();
// not an opcode. this packet sends raw string WORLD OF WARCRAFT CONNECTION - SERVER TO CLIENT"
// because of our implementation, bytes "WO" become the opcode
WorldPacket packet(MSG_VERIFY_CONNECTIVITY);
packet << "RLD OF WARCRAFT CONNECTION - SERVER TO CLIENT";
if (SendPacket(packet) == -1)
return -1;
// Register with ACE Reactor
if (reactor()->register_handler(this, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK) == -1)
{
sLog->outError(LOG_FILTER_NETWORKIO, "WorldSocket::open: unable to register client handler errno = %s", ACE_OS::strerror (errno));
return -1;
}
// reactor takes care of the socket from now on
remove_reference();
return 0;
}
示例13: BitVectorBlock
void BitVector::make_changable(void)
{
if (_block->_reference_count > 1)
{
BitVectorBlock *new_block =
new BitVectorBlock(_block->_data_length,
_block->_infinity_bit_is_one,
_block->_num_significant_bits);
for (size_t chunk_num = 0; chunk_num < _block->_data_length;
++chunk_num)
{
new_block->_data[chunk_num] = _block->_data[chunk_num];
}
remove_reference(_block);
_block = new_block;
}
_has_count = false;
}
示例14: remove_reference
//Copy Assignment Operator
msl::sprite& msl::sprite::operator=(const msl::sprite& copy)
{
//Protect Against Self Assignment
if(this!=©)
{
//Track References to Textures
remove_reference();
//Assign Members
_texture=copy._texture;
_number_of_frames=copy._number_of_frames;
_width=copy._width;
_height=copy._height;
//Track References to Textures
add_reference();
}
//Return
return *this;
}
示例15: destroy_domain_maintainer
void destroy_domain_maintainer(domain_maintainer_t *dm)
{
int i, cnt;
notifier_domain_t *d;
if (!dm) return;
DEBUG_LOG("destroying domain maintainer\n");
cnt = ptr_vector_size(&dm->registered_domains);
for (i = 0; i < cnt; i++) {
d = ptr_vector_get(&dm->registered_domains, i);
if (!d) continue;
if (remove_reference(&d->ref)) {
DEBUG_LOG("freeing domain: \'%.*s\'\n", FMT_STR(d->name));
destroy_notifier_domain(d);
}
}
ptr_vector_destroy(&dm->registered_domains);
cds_mutex_destroy(&dm->mutex);
cds_free(dm);
}