本文整理汇总了C++中UInt64函数的典型用法代码示例。如果您正苦于以下问题:C++ UInt64函数的具体用法?C++ UInt64怎么用?C++ UInt64使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UInt64函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check
BlockInputStreams StorageSystemFunctions::read(
const Names & column_names,
ASTPtr query,
const Context & context,
const Settings & settings,
QueryProcessingStage::Enum & processed_stage,
const size_t max_block_size,
const unsigned threads)
{
check(column_names);
processed_stage = QueryProcessingStage::FetchColumns;
ColumnWithTypeAndName column_name{ std::make_shared<ColumnString>(), std::make_shared<DataTypeString>(), "name" };
ColumnWithTypeAndName column_is_aggregate{ std::make_shared<ColumnUInt8>(), std::make_shared<DataTypeUInt8>(), "is_aggregate" };
const auto & functions = FunctionFactory::instance().functions;
for (const auto & it : functions)
{
column_name.column->insert(it.first);
column_is_aggregate.column->insert(UInt64(0));
}
const auto & aggregate_functions = context.getAggregateFunctionFactory().aggregate_functions;
for (const auto & it : aggregate_functions)
{
column_name.column->insert(it.first);
column_is_aggregate.column->insert(UInt64(1));
}
return BlockInputStreams{ std::make_shared<OneBlockInputStream>(Block{ column_name, column_is_aggregate }) };
}
示例2: Word
WorldInfo World::GetInfo () const noexcept {
Word num=lock.Execute([&] () { return world.size(); });
return WorldInfo{
Word(maintenances),
UInt64(maintenance_time),
Word(loaded),
UInt64(load_time),
Word(unloaded),
Word(saved),
UInt64(save_time),
Word(generated),
UInt64(generate_time),
Word(populated),
UInt64(populate_time),
num,
num*(
sizeof(ColumnContainer::Blocks)+
sizeof(ColumnContainer::Biomes)+
sizeof(ColumnContainer::Populated)
)
};
}
示例3: MemoryInputCallback
static OSStatus MemoryInputCallback (void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
UInt32 inBusNumber,
UInt32 inNumberFrames,
AudioBufferList *ioData)
{
UInt64 now = CAHostTimeBase::GetTheCurrentTime();
OSStatus result = 0;
ReadBuffer *readBuffer = (ReadBuffer*)inRefCon;
if (inTimeStamp->mSampleTime >= readBuffer->totalInputFrames) {
#if VERBOSE
printf ("reading: %.0f past input: %.0f\n", inTimeStamp->mSampleTime,
(double)readBuffer->totalInputFrames);
#endif
result = kEndOfInput;
readBuffer->lastInputFrames = 0;
goto end;
}
// can get pulled multiple times
readBuffer->lastInputFrames += inNumberFrames;
if (UInt64(inTimeStamp->mSampleTime + inNumberFrames) > readBuffer->totalInputFrames) {
// first set this to zero as we're only going to read a partial number of frames
AudioBuffer *buf = ioData->mBuffers;
for (UInt32 i = ioData->mNumberBuffers; i--; ++buf)
memset((Byte *)buf->mData, 0, buf->mDataByteSize);
inNumberFrames = UInt32 (readBuffer->totalInputFrames - UInt64(inTimeStamp->mSampleTime));
}
// copy data from the source to the ioData buffers
{
AudioBuffer *buf = ioData->mBuffers;
AudioBuffer *rBuf = readBuffer->readData->ABL()->mBuffers;
for (UInt32 i = ioData->mNumberBuffers; i--; ++buf, ++rBuf) {
AudioBuffer readB = *rBuf;
readB.mData = static_cast<Float32*>(rBuf->mData) + UInt32(inTimeStamp->mSampleTime);
memcpy (buf->mData, readB.mData, (inNumberFrames * sizeof(Float32)));
}
}
end:
sLastReadTime += (CAHostTimeBase::GetTheCurrentTime() - now);
return result;
}
示例4: Int
namespace Json {
const Value Value::null;
const Int Value::minInt = Int( ~(UInt(-1)/2) );
const Int Value::maxInt = Int( UInt(-1)/2 );
const UInt Value::maxUInt = UInt(-1);
const Int64 Value::minInt64 = Int64( ~(UInt64(-1)/2) );
const Int64 Value::maxInt64 = Int64( UInt64(-1)/2 );
const UInt64 Value::maxUInt64 = UInt64(-1);
const LargestInt Value::minLargestInt = LargestInt( ~(LargestUInt(-1)/2) );
const LargestInt Value::maxLargestInt = LargestInt( LargestUInt(-1)/2 );
const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
/// Unknown size marker
static const unsigned int unknown = (unsigned)-1;
/** Duplicates the specified string value.
* @param value Pointer to the string to duplicate. Must be zero-terminated if
* length is "unknown".
* @param length Length of the value. if equals to unknown, then it will be
* computed using strlen(value).
* @return Pointer on the duplicate instance of string.
*/
static inline char *
duplicateStringValue( const char *value,
unsigned int length = unknown )
{
if ( length == unknown )
length = (unsigned int)strlen(value);
char *newString = static_cast<char *>( malloc( length + 1 ) );
//JSON_ASSERT_MESSAGE( newString != 0, "Failed to allocate string value buffer" );
memcpy( newString, value, length );
newString[length] = 0;
return newString;
}
/** Free the string duplicated by duplicateStringValue().
*/
static inline void
releaseStringValue( char *value )
{
if ( value )
free( value );
}
} // namespace Json
示例5: switch
Value::UInt64
Value::asUInt64() const
{
switch ( type_ )
{
case nullValue:
return false;
case intValue:
return value_.int_;
case uintValue:
return value_.uint_;
case realValue:
JSON_ASSERT_MESSAGE( value_.real_ >= 0 && value_.real_ <= maxUInt64, "Real out of signed integer 64 range" );
return UInt64( value_.real_ );
case int64Value:
JSON_ASSERT_MESSAGE( value_.int64_ >= 0, "Negative integer 64 can not be converted to unsigned integer 64" );
return value_.int64_;
case uint64Value:
return value_.uint64_;
case booleanValue:
return value_.bool_;
case stringValue:
return value_.string_ && value_.string_[0] != 0;
case arrayValue:
case objectValue:
return value_.map_->size() != 0;
default:
JSON_ASSERT_UNREACHABLE;
}
return false; // unreachable;
}
示例6: runTests
void runTests(bool write,BinaryDataHandler &pMem)
{
runTest (write,pMem, std::string("Hallo") );
runTest1 (write,pMem, Time(222.22) );
runTest (write,pMem, Color3f(1.1,2.2,3.3) );
runTest (write,pMem, Color4f(1.1,2.2,3.3,4.4) );
runTest (write,pMem, Color3ub(1,2,3) );
runTest (write,pMem, Color4ub(1,2,3,4) );
runTest (write,pMem, DynamicVolume(DynamicVolume::BOX_VOLUME) );
runTest (write,pMem, DynamicVolume(DynamicVolume::SPHERE_VOLUME) );
runTest1 (write,pMem, BitVector(0xabcd) );
runTest (write,pMem, Plane(Vec3f(1.0,0),0.222) );
runTest (write,pMem, Matrix(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16) );
runTest (write,pMem, Quaternion(Vec3f(1,2,3),22) );
runTest2<bool>(write,pMem, true );
runTest (write,pMem, Int8(-22) );
runTest (write,pMem, UInt8(11) );
runTest (write,pMem, Int16(-10233) );
runTest (write,pMem, UInt16(20233) );
runTest (write,pMem, Int32(-222320233) );
runTest (write,pMem, UInt32(522320233) );
runTest<Int64> (write,pMem, Int64(-522323334) );
runTest (write,pMem, UInt64(44523423) );
runTest (write,pMem, Real32(22.333224) );
runTest (write,pMem, Real64(52.334534533224) );
runTest (write,pMem, Vec2f(1.1,2.2) );
runTest (write,pMem, Vec3f(1.1,2.2,3.3) );
runTest (write,pMem, Vec4f(1.1,2.2,3.3,4.4) );
runTest (write,pMem, Pnt2f(1.1,2.2) );
runTest (write,pMem, Pnt2d(1.1,2.2) );
runTest (write,pMem, Pnt3f(1.1,2.2,3.3) );
runTest (write,pMem, Pnt3d(1.1,2.2,3.3) );
runTest (write,pMem, Pnt4f(1.1,2.2,3.3,4.4) );
runTest (write,pMem, Pnt4d(1.1,2.2,3.3,4.4) );
}
示例7: GetLocalTime
uint64 TSysTm::GetCurLocMSecs(){
SYSTEMTIME SysTm; FILETIME FileTm;
GetLocalTime(&SysTm);
IAssert(SystemTimeToFileTime(&SysTm, &FileTm));
TUInt64 UInt64(uint(FileTm.dwHighDateTime), uint(FileTm.dwLowDateTime));
return UInt64.Val/uint64(10000);
}
示例8: switch
// Input IO Proc
// Receiving input for 1 buffer + safety offset into the past
OSStatus AudioThruEngine::InputIOProc ( AudioDeviceID inDevice,
const AudioTimeStamp* inNow,
const AudioBufferList* inInputData,
const AudioTimeStamp* inInputTime,
AudioBufferList* outOutputData,
const AudioTimeStamp* inOutputTime,
void* inClientData)
{
AudioThruEngine *This = (AudioThruEngine *)inClientData;
switch (This->mInputProcState) {
case kStarting:
This->mInputProcState = kRunning;
break;
case kStopRequested:
AudioDeviceStop(inDevice, InputIOProc);
This->mInputProcState = kOff;
return noErr;
default:
break;
}
This->mLastInputSampleCount = inInputTime->mSampleTime;
This->mInputBuffer->Store((const Byte *)inInputData->mBuffers[0].mData,
This->mInputDevice.mBufferSizeFrames,
UInt64(inInputTime->mSampleTime));
// This->ApplyLoad(This->mInputLoad);
return noErr;
}
示例9: fillRow
void StorageSystemFunctions::fillData(MutableColumns & res_columns, const Context &, const SelectQueryInfo &) const
{
const auto & functions_factory = FunctionFactory::instance();
const auto & function_names = functions_factory.getAllRegisteredNames();
for (const auto & name : function_names)
{
fillRow(res_columns, name, UInt64(0), functions_factory);
}
const auto & aggregate_functions_factory = AggregateFunctionFactory::instance();
const auto & aggregate_function_names = aggregate_functions_factory.getAllRegisteredNames();
for (const auto & name : aggregate_function_names)
{
fillRow(res_columns, name, UInt64(1), aggregate_functions_factory);
}
}
示例10: LoadUCI
Void
WINAPI
LoadUCI(
tTVPGraphicLoadMode mode,
tjs_int32 keyidx,
tTJSBinaryStream *src,
#if !defined(FATE_STAY_NIGHT)
tTVPMetaInfoPushCallback metainfopushcallback,
#endif
tTVPGraphicScanLineCallback scanlinecallback
)
{
void *formatdata, *callbackdata;
tTVPGraphicSizeCallback sizecallback;
BOOL bFindMeta;
Int32 y, w, header, strideOut, alphatype;
PByte pbBuffer;
PVOID lpBuffer;
UCIInfo uci;
INLINE_ASM
{
mov formatdata, eax;
mov callbackdata, edx;
mov sizecallback, ecx;
}
UInt64 (TJS_INTF_METHOD *F_GetSize)(tTJSBinaryStream *src) = (UInt64 (TJS_INTF_METHOD *)(tTJSBinaryStream*))FUNC_GET_SIZE;
ReadBuffer(src, &header, 4);
if ((header & 0xFFFFFF) != TAG3('UCI'))
{
SetPosition(src, GetPosition(src) - 4);
if (FTVPLoadBMP == NULL)
return;
INLINE_ASM
{
mov eax, formatdata;
mov edx, callbackdata;
mov ecx, sizecallback;
push scanlinecallback;
}
IF_EXIST(metainfopushcallback)
{
INLINE_ASM push metainfopushcallback;
}
INLINE_ASM
{
push src;
push keyidx;
push mode;
call FTVPLoadBMP;
}
return;
}
示例11: switch
Value::Int64
Value::asInt64() const
{
switch ( type_ )
{
case nullValue:
return 0;
case intValue:
return value_.int_;
case uintValue:
JSON_ASSERT_MESSAGE( value_.uint_ <= UInt64(maxInt64), "unsigned integer out of Int64 range" );
return value_.uint_;
case realValue:
JSON_ASSERT_MESSAGE( value_.real_ >= minInt64 && value_.real_ <= maxInt64, "Real out of Int64 range" );
return Int( value_.real_ );
case booleanValue:
return value_.bool_ ? 1 : 0;
case stringValue:
case arrayValue:
case objectValue:
JSON_ASSERT_MESSAGE( false, "Type is not convertible to Int64" );
default:
JSON_ASSERT_UNREACHABLE;
}
return 0; // unreachable;
}
示例12: get
UInt64 Message::getContentLength() const
{
const std::string& contentLength = get(CONTENT_LENGTH, EMPTY);
if (!contentLength.empty())
{
return util::strtoi<UInt64>(contentLength);
}
else return UInt64(UNKNOWN_CONTENT_LENGTH);
}
示例13: while
STDMETHODIMP CFolderOutStream::Write(const void *data,
UInt32 size, UInt32 *processedSize)
{
UInt32 realProcessedSize = 0;
while(_currentIndex < _extractStatuses->Size())
{
if (_fileIsOpen)
{
UInt32 index = _startIndex + _currentIndex;
const CFileItem &fileInfo = _archiveDatabase->Files[index];
UInt64 fileSize = fileInfo.UnPackSize;
UInt32 numBytesToWrite = (UInt32)MyMin(fileSize - _filePos,
UInt64(size - realProcessedSize));
UInt32 processedSizeLocal;
RINOK(_outStreamWithHash->Write((const Byte *)data + realProcessedSize,
numBytesToWrite, &processedSizeLocal));
_filePos += processedSizeLocal;
realProcessedSize += processedSizeLocal;
if (_filePos == fileSize)
{
bool digestsAreEqual;
if (fileInfo.IsFileCRCDefined && _checkCrc)
digestsAreEqual = fileInfo.FileCRC == _outStreamWithHashSpec->GetCRC();
else
digestsAreEqual = true;
RINOK(_extractCallback->SetOperationResult(
digestsAreEqual ?
NArchive::NExtract::NOperationResult::kOK :
NArchive::NExtract::NOperationResult::kCRCError));
_outStreamWithHashSpec->ReleaseStream();
_fileIsOpen = false;
_currentIndex++;
}
if (realProcessedSize == size)
{
if (processedSize != NULL)
*processedSize = realProcessedSize;
return WriteEmptyFiles();
}
}
else
{
RINOK(OpenFile());
_fileIsOpen = true;
_filePos = 0;
}
}
if (processedSize != NULL)
*processedSize = size;
return S_OK;
}
示例14: switch
Value::UInt64 Value::asUInt64() const {
switch (type_) {
case intValue:
JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
return UInt64(value_.int_);
case uintValue:
return UInt64(value_.uint_);
case realValue:
JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
"double out of UInt64 range");
return UInt64(value_.real_);
case nullValue:
return 0;
case booleanValue:
return value_.bool_ ? 1 : 0;
default:
break;
}
JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
}
示例15: UInt64
void AUTimestampGenerator::AddOutputTime(const AudioTimeStamp &inTimeStamp, Float64 expectedDeltaFrames, double outputSampleRate, double rateScalarAdj)
{
mState.mRateScalarAdj = rateScalarAdj;
mState.mLastOutputTime = mState.mCurrentOutputTime;
mState.mInputSampleTimeForOutputPull = mState.mNextInputSampleTime;
mState.mCurrentOutputTime = inTimeStamp;
if (mState.mBypassed)
return;
if (mState.mHostTimeDiscontinuityCorrection && !(mState.mCurrentOutputTime.mFlags & kAudioTimeStampHostTimeValid) && (mState.mLastOutputTime.mFlags & kAudioTimeStampHostTimeValid)) {
// no host time here but we had one last time, interpolate one
double rateScalar = (mState.mCurrentOutputTime.mFlags & kAudioTimeStampRateScalarValid) ? mState.mCurrentOutputTime.mRateScalar : 1.0;
Float64 deltaSamples = mState.mCurrentOutputTime.mSampleTime - mState.mLastOutputTime.mSampleTime;
mState.mCurrentOutputTime.mHostTime = mState.mLastOutputTime.mHostTime +
UInt64(CAHostTimeBase::GetFrequency() * deltaSamples * rateScalar / outputSampleRate);
mState.mCurrentOutputTime.mFlags |= kAudioTimeStampHostTimeValid;
#if DEBUG
if (mVerbosity > 1)
printf("synthesized host time: %.3f (%.3f + %.f smp @ %.f Hz, rs %.3f\n", DebugHostTime(mState.mCurrentOutputTime), DebugHostTime(mState.mLastOutputTime), deltaSamples, outputSampleRate, rateScalar);
#endif
}
// copy rate scalar
if (rateScalarAdj != 1.0) {
if (mState.mCurrentOutputTime.mFlags & kAudioTimeStampRateScalarValid)
mState.mCurrentOutputTime.mRateScalar *= rateScalarAdj;
else {
mState.mCurrentOutputTime.mRateScalar = rateScalarAdj;
mState.mCurrentOutputTime.mFlags |= kAudioTimeStampRateScalarValid;
}
}
if (mFirstTime) {
mFirstTime = false;
mState.mDiscontinuous = false;
mState.mDiscontinuityDeltaSamples = 0.;
if (!mState.mStartInputAtZero) {
mState.mNextInputSampleTime = mState.mCurrentOutputTime.mSampleTime;
mState.mInputSampleTimeForOutputPull = mState.mNextInputSampleTime;
}
} else {
mState.mDiscontinuous = fnotequal(mState.mCurrentOutputTime.mSampleTime, mState.mNextOutputSampleTime);
mState.mDiscontinuityDeltaSamples = mState.mCurrentOutputTime.mSampleTime - mState.mNextOutputSampleTime;
// time should never go backwards...
if (mState.mDiscontinuityDeltaSamples < 0.)
mState.mDiscontinuityDeltaSamples = 0.;
#if DEBUG
if (mVerbosity > 1)
if (mState.mDiscontinuous)
printf("%-20.20s: *** DISCONTINUOUS, got " TSGFMT ", expected " TSGFMT "\n", mDebugName, (SInt64)mState.mCurrentOutputTime.mSampleTime, (SInt64)mState.mNextOutputSampleTime);
#endif
}
mState.mNextOutputSampleTime = mState.mCurrentOutputTime.mSampleTime + expectedDeltaFrames;
}