本文整理汇总了C++中IsSet函数的典型用法代码示例。如果您正苦于以下问题:C++ IsSet函数的具体用法?C++ IsSet怎么用?C++ IsSet使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsSet函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1:
void
MediaWindow::SmartNode::_FreeNode()
{
if (!IsSet())
return;
// TODO: check error codes
BMediaRoster* roster = BMediaRoster::Roster();
roster->StopWatching(fMessenger, *fNode, B_MEDIA_WILDCARD);
roster->ReleaseNode(*fNode);
delete fNode;
fNode = NULL;
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:12,代码来源:MediaWindow.cpp
示例2: CRY_ASSERT
//------------------------------------------------------------------------
void CWeapon::CAnimationFiringLocator::Set()
{
CRY_ASSERT(!IsSet());
CRY_ASSERT(m_pOwnerWeapon);
IWeaponFiringLocator* pPreviousFiringLocator = m_pOwnerWeapon->GetFiringLocator();
if (pPreviousFiringLocator != this)
{
m_pPreviousFiringLocator = pPreviousFiringLocator;
m_pOwnerWeapon->SetFiringLocator(this);
}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:13,代码来源:WeaponEvent.cpp
示例3: empilevoisins
/* ==================================== */
void empilevoisins(int32_t x, int32_t rs, int32_t N, Fifo *FIFOna, Fifo *FIFOea, Fifo *FIFOsa, Fifo *FIFOoa)
/* ==================================== */
{
int32_t y, z, k;
/* x est un point qui vient de passer a 0 */
for (k = 0; k < 8; k++)
{
y = voisin(x, k, rs, N);
if ((y!=-1) && !IsSet(y,MINI) && !IsSet(y,EN_FIFO) && nonbord(y,rs,N))
{
z = voisin(y, NORD, rs, N);
if ((z != 0) && IsSet(z, MINI))
{ FifoPush(FIFOna, y); Set(y, EN_FIFO); goto nextk; }
z = voisin(y, SUD, rs, N);
if ((z != 0) && IsSet(z, MINI))
{ FifoPush(FIFOsa, y); Set(y, EN_FIFO); goto nextk; }
z = voisin(y, EST, rs, N);
if ((z != 0) && IsSet(z, MINI))
{ FifoPush(FIFOea, y); Set(y, EN_FIFO); goto nextk; }
z = voisin(y, OUEST, rs, N);
if ((z != 0) && IsSet(z, MINI))
{ FifoPush(FIFOoa, y); Set(y, EN_FIFO); goto nextk; }
}
nextk: ;
}
} /* empilevoisins() */
开发者ID:Johnson13,项目名称:xLearn,代码行数:28,代码来源:lsquel.c
示例4: ClientRect
void SButton::Paint( GC& gc, const crect& paintRect )
{
crect cr = ClientRect();
unsigned colorBg = UiGetColor( uiBackground, 0, 0, 0xFFFFFF );
gc.SetFillColor( colorBg ); //CCC
gc.FillRect( cr );
if ( group > 0 )
{
DrawCE( gc, 1, ( cr.Height() - 13 ) / 2, IsSet() );
}
else
{
DrawCB( gc, 1, ( cr.Height() - 13 ) / 2, IsSet() );
}
gc.Set( GetFont() );
cpoint tsize = text.GetTextExtents(gc);
gc.SetFillColor( colorBg );
//gc.SetTextColor( UiGetColor( uiColor, 0, 0, 0 ) );
//gc.TextOutF( 14 + 1 + 1 + 1 , ( cr.Height() - tsize.y ) / 2, text.data() );
UiCondList ucl;
int color_text = UiGetColor(uiColor, uiItem, &ucl, 0x0);
int color_hotkey = UiGetColor(uiHotkeyColor, uiItem, &ucl, 0x0);
text.DrawItem(gc, 14 + 1 + 1 + 1, (cr.Height() - tsize.y) / 2, color_text, color_hotkey);
if ( InFocus() )
{
crect rect;
rect.left = 14 + 2;
rect.top = ( cr.Height() - tsize.y - 2 ) / 2;
rect.right = rect.left + tsize.x + 4;
rect.bottom = rect.top + tsize.y + 2;
DrawBorder( gc, rect, UiGetColor( uiFocusFrameColor, 0, 0, 0 ) ); //CCC
}
}
开发者ID:KonstantinKuklin,项目名称:WalCommander,代码行数:40,代码来源:swl_sbutton.cpp
示例5: _getPort
void ClientStore::_enumerateStreams(std::vector<StreamId>& out,
StreamEnumFilter filter) const
{
std::vector<StreamId> ids;
// Request the ids for the static streams. Since we are replicating
// static streams on-demand, we cannot just query our local store but
// must ask the server.
Message response = {0};
ClientPort& port = _getPort();
port.call(&response, RpcApi::CCV_StreamEnumerate, filter);
uint32_t n = response.parameter0;
ThrowOn((response.payloadType != MessagePayloadType::MptData) ||
((response.data.payloadLength % sizeof(StreamId)) != 0) ||
(response.data.payloadLength / sizeof(StreamId) != n),
RpcMessageMalformedException);
if (n > 0) {
assert(response.data.payload != nullptr);
assert(n <= SIMUTRACE_STORE_MAX_NUM_STREAMS);
StreamId* buffer = reinterpret_cast<StreamId*>(response.data.payload);
ids.assign(buffer, buffer + n);
}
// Now add the dynamic streams that this client session possesses.
std::vector<Stream*> dynStreams;
this->Store::_enumerateStreams(dynStreams, StreamEnumFilter::SefDynamic);
for (auto stream : dynStreams) {
assert(IsSet(stream->getFlags(), StreamFlags::SfDynamic));
assert(!IsSet(stream->getFlags(), StreamFlags::SfHidden));
ids.push_back(stream->getId());
}
std::swap(ids, out);
}
开发者ID:blaquee,项目名称:simutrace,代码行数:40,代码来源:ClientStore.cpp
示例6: MatchRange
bool RegExpMatch::MatchRange(RegExpContext &context ,const char *str)
{
if (IsSet(M_START))
{
if (context.matchCount < 10)
{
context.matchStack[context.matchStackTop++] = context.matchCount;
context.matchOffsets[context.matchCount][0] = str - context.beginning;
context.matchOffsets[context.matchCount++][1] = 0;
return true;
}
}
if (IsSet(M_END))
{
if (context.matchStackTop)
{
context.matchOffsets[context.matchStack[--context.matchStackTop]][1] = str - context.beginning;
return true;
}
}
return false;
}
开发者ID:bencz,项目名称:OrangeC,代码行数:22,代码来源:RegExp.cpp
示例7: GetSetCount
int CBitSet::GetSetCount()
{
int nRet = 0;
for (int i = 0; i < m_nSize; ++i)
{
if (IsSet(i))
{
nRet++;
}
}
return nRet;
}
开发者ID:zxymd5,项目名称:MyWinBitTorrent,代码行数:13,代码来源:BitSet.cpp
示例8: while
TOptional<FExpressionError> FTokenDefinitions::ConsumeTokens(FExpressionTokenConsumer& Consumer) const
{
auto& Stream = Consumer.GetStream();
while(!Stream.IsEmpty())
{
auto Error = ConsumeToken(Consumer);
if (Error.IsSet())
{
return Error;
}
}
return TOptional<FExpressionError>();
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:14,代码来源:ExpressionParser.cpp
示例9: GetRaw
Int64 RarTime::GetRaw()
{
if (!IsSet())
return(0);
#ifdef _WIN_32
FILETIME ft;
GetWin32(&ft);
return(int32to64(ft.dwHighDateTime,ft.dwLowDateTime));
#elif defined(_UNIX) || defined(_EMX)
time_t ut=GetUnix();
return(int32to64(0,ut)*10000000+rlt.Reminder);
#else
return(0);
#endif
}
开发者ID:GDXN,项目名称:Par-N-Rar,代码行数:15,代码来源:timefn.cpp
示例10: FuncIS_EQUAL_SET
Obj FuncIS_EQUAL_SET (
Obj self,
Obj list1,
Obj list2 )
{
/* check the arguments, convert to sets if necessary */
while ( ! IS_SMALL_LIST(list1) ) {
list1 = ErrorReturnObj(
"IsEqualSet: <list1> must be a small list (not a %s)",
(Int)TNAM_OBJ(list1), 0L,
"you can replace <list1> via 'return <list1>;'" );
}
if ( ! IsSet( list1 ) ) list1 = SetList( list1 );
while ( ! IS_SMALL_LIST(list2) ) {
list2 = ErrorReturnObj(
"IsEqualSet: <list2> must be a small list (not a %s)",
(Int)TNAM_OBJ(list2), 0L,
"you can replace <list2> via 'return <list2>;'" );
}
if ( ! IsSet( list2 ) ) list2 = SetList( list2 );
/* and now compare them */
return (EqSet( list1, list2 ) ? True : False );
}
开发者ID:YurieCo,项目名称:gap,代码行数:24,代码来源:set.c
示例11: NS_WARN_IF
NS_IMETHODIMP
InsertNodeTransaction::UndoTransaction()
{
if (NS_WARN_IF(!mContentToInsert) ||
NS_WARN_IF(!mPointToInsert.IsSet())) {
return NS_ERROR_NOT_INITIALIZED;
}
// XXX If the inserted node has been moved to different container node or
// just removed from the DOM tree, this always fails.
ErrorResult error;
mPointToInsert.GetContainer()->RemoveChild(*mContentToInsert, error);
if (NS_WARN_IF(error.Failed())) {
return error.StealNSResult();
}
return NS_OK;
}
开发者ID:luke-chang,项目名称:gecko-1,代码行数:16,代码来源:InsertNodeTransaction.cpp
示例12:
/*=====================================================================*/
void
GUIContainer::MouseButton( const SDL_MouseButtonEvent& rcEvent )
{
static std::vector<GUIMain*>::size_type stvector;
static GUIMain* pguimain;
// We return immediatly if this is NOT visible
if ( IsSet( OC_GUIMAIN_VISIBLE ) == false )
return;
// Send the mouse button event to all objects
for ( stvector = 0; stvector < this->vectorpguimain.size(); stvector++ ) {
if ( (pguimain = vectorpguimain[ stvector ]) != NULL )
pguimain->MouseButton( rcEvent );
}
}
开发者ID:AnotherFoxGuy,项目名称:OpenCity,代码行数:17,代码来源:guicontainer.cpp
示例13: Run
bool SchedulerTask::Run(time_t time)
{
if (!IsSet() || !IsEnabled())
return true;
if (time >= timeToFire)
{
pCallback();
if (countDown != DO_IT_FOREVER)
countDown --;
UpdateTime();
}
return true;
}
开发者ID:Gabeki17,项目名称:MinimOSD,代码行数:16,代码来源:scheduler.cpp
示例14: update_abp_tax_icb_rate
EXPORT int update_abp_tax_icb_rate(ABP_DBHANDLE dbhandle, ABP_TAX_ICB_RATE tax_icb_rate)
{
int retval;
Arb_connection *connection;
CUSTOMER_ID_ACCT_MAP_DATA *cid;
TAX_UNIV_ICB_DATA *tui;
int count;
if (WRONG_OBJ_TYPE(tax_icb_rate, API_TAX_ICB_RATE))
return ABP_ARGERR;
if (NotCustDbhandle(dbhandle))
return ABP_ARGERR;
connection = dbhandle->cust_connection;
((ABP_ERR_DATA *)connection->user_data)->is_set = FALSE;
cid = tax_icb_rate->customer_id_acct_map_data;
tui = tax_icb_rate->tax_univ_icb_data;
if (!IsSet(tax_univ_icb_tui_id,tui)){
abp_put_misc_message(connection, ABP_NO_VALUE_ERR, "tui_id");
return ABP_MISC_ERR;
}
Unset(tax_univ_icb_tax_pkg_inst_id, tui);
Unset(tax_univ_icb_tax_class, tui);
Unset(tax_univ_icb_account_no, tui);
if ((retval = abp_begin_transaction_inner(dbhandle, "abp_update_tax_icb_rate"))
!= ABP_STATUS_OK)
return ABP_DBERR;
if (update_tax_univ_icb(connection,tui)==FAILURE )
return ABP_DBERR;
count = arb_dbcount(connection);
if (count != 1) {
abp_put_misc_message(connection, count ? ABP_ROW_NOT_UNIQUE : ABP_ROW_NOT_FOUND, "TAX_UNIV_ICB");
retval = ABP_MISC_ERR;
goto rollback;
}
return abp_commit_transaction_inner(dbhandle, "abp_update_tax_icb_rate");
rollback:
abp_roll_back_transaction_inner(dbhandle, "abp_update_tax_icb_rate");
return retval;
}
开发者ID:huilang22,项目名称:Projects,代码行数:47,代码来源:tax_icb_rate_api.c
示例15: assert
std::unique_ptr<Stream> ClientStore::_createStream(StreamId id,
StreamDescriptor& desc, BufferId buffer)
{
assert(id == INVALID_STREAM_ID);
Message response = {0};
ClientPort& port = _getPort();
StreamBuffer* buf = _getStreamBuffer(buffer);
ThrowOnNull(buf, NotFoundException,
stringFormat("stream buffer with id %d", buffer));
if (IsSet(desc.flags, SfDynamic)) {
const DynamicStreamDescriptor& dyndesc =
reinterpret_cast<DynamicStreamDescriptor&>(desc);
// For regular streams the server generates a valid id. For
// dynamic streams we have to do this on our own, as dynamic
// streams are local to the client. The ids must not collide!
// The server generates ids for regular streams in the lower
// positive integer range. We therefore generate the ids for
// dynamic streams in the high positive integer range. The
// limit for the number of streams (see Version.h) prevents a
// collision.
StreamId sid = --_dynamicStreamIdBoundary;
#ifdef _DEBUG
std::vector<StreamId> ids;
_enumerateStreams(ids, StreamEnumFilter::SefRegular);
StreamId max = *std::max_element(ids.cbegin(), ids.cend());
assert(max < sid);
#endif
return std::unique_ptr<Stream>(
new DynamicStream(sid, dyndesc, *buf, getSession()));
} else {
port.call(&response, RpcApi::CCV_StreamRegister, &desc,
sizeof(StreamDescriptor), buffer);
StreamId rid = static_cast<StreamId>(response.parameter0);
return std::unique_ptr<Stream>(
new StaticStream(rid, desc, *buf, getSession()));
}
}
开发者ID:blaquee,项目名称:simutrace,代码行数:46,代码来源:ClientStore.cpp
示例16: IsSet
void MtlBlinnSW3D::Transmit(ShadeContext3D &sc)
{
BlinnBlock &block = (BlinnBlock &) sc.GetMaterialBlock(this);
const Vector4f &vertexColor = IsSet(block.VertexColor) ? *block.VertexColor : WHITE4F;
Color4f diffuseMtl;
if (DiffuseMtl)
{
DiffuseMtl->Shade(sc);
diffuseMtl = *block.Color;
}
else
diffuseMtl = WHITE4F;
Color4f Kd = Mul(PreDiffuse, Mul(diffuseMtl, vertexColor));
if (fabs(Kd.A) < 0.0001f)
Kd = Color4f(1.0f, 1.0f, 1.0f, 0.0f);
else
{
Kd.R /= Kd.A;
Kd.G /= Kd.A;
Kd.B /= Kd.A;
}
float32 y = Kd.Luminance();
Color4f satColor = Lerp(Color4f(y, y, y, 1.0f), Kd, Saturation);
satColor.A = 1.0f;
Color4f textureDetail = Lerp(Color4f(0.0f, 0.0f, 0.0f, 1.0f), satColor, ColorDetail);
textureDetail.A = 1.0f;
float32 alphaDetail = Lerp(0.0f, 1.0f - Kd.A, AlphaDetail);
Color4f outTrans = (1.0f - alphaDetail) * textureDetail + Color4f(alphaDetail); // compute 1 - (1 - ad) * (1 - td)
outTrans = Color4f(1.0f) - Mul(Color4f(1.0f) - outTrans, Color4f(1.0f) - Transmittance);
sc.Transmittance.R = max(min(outTrans.R, 1.0f), 0.0f);
sc.Transmittance.G = max(min(outTrans.G, 1.0f), 0.0f);
sc.Transmittance.B = max(min(outTrans.B, 1.0f), 0.0f);
sc.Transmittance.A = outTrans.A;
FuASSERT(sc.Transmittance.A >= 0.0f && sc.Transmittance.A <= 1.002f, (""));
}
开发者ID:reichofevil,项目名称:3delight_to_fusion,代码行数:45,代码来源:3D_MaterialBlinn.cpp
示例17: Def
TOptional<FExpressionError> FTokenDefinitions::ConsumeToken(FExpressionTokenConsumer& Consumer) const
{
auto& Stream = Consumer.GetStream();
// Skip over whitespace
if (bIgnoreWhitespace)
{
TOptional<FStringToken> Whitespace = Stream.ParseWhitespace();
if (Whitespace.IsSet())
{
Stream.SetReadPos(Whitespace.GetValue());
}
}
if (Stream.IsEmpty())
{
// Trailing whitespace in the expression.
return TOptional<FExpressionError>();
}
const auto* Pos = Stream.GetRead();
// Try each token in turn. First come first served.
for (const auto& Def : Definitions)
{
// Call the token definition
auto Error = Def(Consumer);
if (Error.IsSet())
{
return Error;
}
// If the stream has moved on, the definition added one or more tokens, so
else if (Stream.GetRead() != Pos)
{
return TOptional<FExpressionError>();
}
}
// No token definition matched the stream at its current position - fatal error
FFormatOrderedArguments Args;
Args.Add(FText::FromString(Consumer.GetStream().GetErrorContext()));
Args.Add(Consumer.GetStream().GetPosition());
return FExpressionError(FText::Format(LOCTEXT("LexicalError", "Unrecognized token '{0}' at character {1}"), Args));
}
开发者ID:WasPedro,项目名称:UnrealEngine4.11-HairWorks,代码行数:44,代码来源:ExpressionParser.cpp
示例18: rn_gen
/** \author Portable Random number generator by George Marsaglia
* \author Amber 3.0 Rev A implementation by George Seibel
*
* This random number generator originally appeared in 'Toward a Universal
* Random Number Generator' by George Marsaglia and Arif Zaman. Florida
* State University Report: FSU-SCRI-87-50 (1987)
*
* It was later modified by F. James and published in 'A Review of Pseudo-
* random Number Generators'
*
* This is claimed to be the best known random number generator available.
* It passes ALL of the tests for random number generators and has a
* period of 2^144, is completely portable (gives bit identical results on
* all machines with at least 24-bit mantissas in the floating point
* representation).
*
* The algorithm is a combination of a Fibonacci sequence (with lags of 97
* and 33, and operation "subtraction plus one, modulo one") and an
* "arithmetic sequence" (using subtraction).
*
* \return A random number between 0.0 and 1.0
* \return -1.0 if the random number generator is not initialized.
*/
double Random_Number::rn_gen() {
if (!IsSet()) {
mprinterr("Error: random number generator not initialized.");
return -1.0;
}
double uni = RN_generator.u[RN_generator.i97] - RN_generator.u[RN_generator.j97];
if (uni < 0.0) uni += 1.0;
RN_generator.u[RN_generator.i97] = uni;
RN_generator.i97--;
if (RN_generator.i97 == -1) RN_generator.i97 = 96;
RN_generator.j97--;
if (RN_generator.j97 == -1) RN_generator.j97 = 96;
RN_generator.c -= RN_generator.cd;
if (RN_generator.c < 0.0) RN_generator.c += RN_generator.cm;
uni -= RN_generator.c;
if (uni < 0.0) uni += 1.0;
return uni;
}
开发者ID:Amber-MD,项目名称:cpptraj,代码行数:42,代码来源:Random.cpp
示例19: cease_emf_products
static int
cease_emf_products(Arb_connection *connection, PRODUCT_VIEW_DATA *data,
char *szcease_date)
{
/*
* Perform the indicated disconnect. Return status.
*/
int retval;
short disconnect_reason;
Arb_date cease_date;
if (IsSet(product_view_disconnect_reason, data))
disconnect_reason = data->disconnect_reason;
else
if ((retval = find_default_disconnect_reason(connection,
&disconnect_reason))
!= ABP_STATUS_OK)
return retval;
if (szcease_date && (*szcease_date != '\0')) {
if (api_string_to_Arbdate(szcease_date,&cease_date, 1) == FAILURE) {
abp_put_misc_message(connection, ABP_BAD_DATE_STRING, szcease_date);
return ABP_MISC_ERR;
}
}
/* arb_setup_proc_exec(connection, &proc_api_cease_serv_inst_product, SQL_EXECUTE_NOW,
"tracking_id", data->tracking_id, ARG_NOT_NULL,
"tracking_id_serv", data->tracking_id_serv, ARG_NOT_NULL,
"cease_date", &cease_date, (szcease_date && (*szcease_date != '\0')) ? ARG_NOT_NULL : ARG_IS_NULL,
"disconnect_reason", disconnect_reason, ARG_NOT_NULL, NO_MORE_ARGS);*/
arb_setup_proc_exec(connection,&proc_api_pp_disc_alacarte_product, SQL_EXECUTE_NOW,
"track_id",data->tracking_id, ARG_NOT_NULL,
"track_id_serv",data->tracking_id_serv, ARG_NOT_NULL,
"level",1,ARG_NOT_NULL, /* 1 signifies service level product */
"product_stop", &cease_date, (szcease_date && (*szcease_date != '\0')) ? ARG_NOT_NULL : ARG_IS_NULL,
"disc_reason",disconnect_reason, ARG_NOT_NULL, NO_MORE_ARGS);
if (arb_query_status(connection) == FAILURE)
return ABP_DBERR;
else
return ABP_STATUS_OK;
}
开发者ID:huilang22,项目名称:Projects,代码行数:42,代码来源:serv_inst_product_api.c
示例20: TString
TString CBorderLine::save(const TString& tag) const
{
if ( !IsSet() )
{
return TString();
}
std::stringstream border;
border << '<' << tag << " style=\"" << g_styles[ m_style ] << '\"';
if ( m_color.IsSet() )
{
border << '>' << '\n';
border << "<color" << m_color.save() << '/' << '>' << '\n';
border << '<' << '/' << tag << '>' << '\n';
}
else
{
border << '/' << '>' << '\n';
}
return border.str();
}
开发者ID:ssyi,项目名称:libmsdoc.work,代码行数:20,代码来源:cborderline.cpp
注:本文中的IsSet函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论