本文整理汇总了C++中Output函数的典型用法代码示例。如果您正苦于以下问题:C++ Output函数的具体用法?C++ Output怎么用?C++ Output使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Output函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Output
void CSocketClient::OnError( const _tstring &message )
{
Output( message );
}
示例2: main
int main(int argc, char* argv[])
{
PRTime start = _PR_Now();
char exePath[MAXPATHLEN];
#ifdef XP_MACOSX
TriggerQuirks();
#endif
nsresult rv = mozilla::BinaryPath::Get(argv[0], exePath);
if (NS_FAILED(rv)) {
Output("Couldn't calculate the application directory.\n");
return 255;
}
char *lastSlash = strrchr(exePath, XPCOM_FILE_PATH_SEPARATOR[0]);
if (!lastSlash || (size_t(lastSlash - exePath) > MAXPATHLEN - sizeof(XPCOM_DLL) - 1))
return 255;
strcpy(++lastSlash, XPCOM_DLL);
int gotCounters;
#if defined(XP_UNIX)
struct rusage initialRUsage;
gotCounters = !getrusage(RUSAGE_SELF, &initialRUsage);
#elif defined(XP_WIN)
IO_COUNTERS ioCounters;
gotCounters = GetProcessIoCounters(GetCurrentProcess(), &ioCounters);
#endif
// We do this because of data in bug 771745
XPCOMGlueEnablePreload();
rv = XPCOMGlueStartup(exePath);
if (NS_FAILED(rv)) {
Output("Couldn't load XPCOM.\n");
return 255;
}
// Reset exePath so that it is the directory name and not the xpcom dll name
*lastSlash = 0;
rv = XPCOMGlueLoadXULFunctions(kXULFuncs);
if (NS_FAILED(rv)) {
Output("Couldn't load XRE functions.\n");
return 255;
}
XRE_StartupTimelineRecord(mozilla::StartupTimeline::START, start);
#ifdef XRE_HAS_DLL_BLOCKLIST
XRE_SetupDllBlocklist();
#endif
if (gotCounters) {
#if defined(XP_WIN)
XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_OPS,
int(ioCounters.ReadOperationCount));
XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_READ_TRANSFER,
int(ioCounters.ReadTransferCount / 1024));
IO_COUNTERS newIoCounters;
if (GetProcessIoCounters(GetCurrentProcess(), &newIoCounters)) {
XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_OPS,
int(newIoCounters.ReadOperationCount - ioCounters.ReadOperationCount));
XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_READ_TRANSFER,
int((newIoCounters.ReadTransferCount - ioCounters.ReadTransferCount) / 1024));
}
#elif defined(XP_UNIX)
XRE_TelemetryAccumulate(mozilla::Telemetry::EARLY_GLUESTARTUP_HARD_FAULTS,
int(initialRUsage.ru_majflt));
struct rusage newRUsage;
if (!getrusage(RUSAGE_SELF, &newRUsage)) {
XRE_TelemetryAccumulate(mozilla::Telemetry::GLUESTARTUP_HARD_FAULTS,
int(newRUsage.ru_majflt - initialRUsage.ru_majflt));
}
#endif
}
int result;
{
ScopedLogging log;
result = do_main(argc, argv);
}
XPCOMGlueShutdown();
return result;
}
示例3: UserComment
void UserComment (const char* Comment)
/* Output a comment line */
{
Output ("; %s", Comment);
LineFeed ();
}
示例4: zero
void SecularUpdateLast
( bool initialize,
const Real& rho,
const Matrix<Real>& z,
LastState<Real>& state,
const SecularEVDCtrl<Real>& ctrl )
{
DEBUG_CSE
const Real zero(0);
const Int n = state.dMinusShift.Height();
const Int origin = n-1;
if( state.secular <= zero )
state.rootRelLowerBound =
Max( state.rootRelLowerBound, state.rootRelEst );
else
state.rootRelUpperBound =
Min( state.rootRelUpperBound, state.rootRelEst );
if( ctrl.progress )
Output
("Relative interval is [",state.rootRelLowerBound,",",
state.rootRelUpperBound,"]");
const Real kGap = state.dMinusShift(origin);
const Real km1Gap = state.dMinusShift(origin-1);
Real a = state.secular - km1Gap*state.psiMinusDeriv -
kGap*state.psiOriginDeriv;
Real eta;
if( initialize )
{
// Force flipping always?
if( ctrl.negativeFix == CLIP_NEGATIVES )
a = Max( a, zero );
else
a = Abs( a );
if( a == zero )
{
// TODO(poulson): Explain this special case.
//
// Note that LAPACK's {s,d}lasd4 [CITATION] uses the equivalent of
//
// eta = rho - rootEst,
//
// while LAPACK's {s,d}laed4 [CITATION] has such an updated
// commented out and
// instead performs the following.
eta = state.rootRelUpperBound - state.rootRelEst;
}
else
{
// We Approach From the Right with psi_{n-2}(x) osculatorally
// interpolated as G(x; d(n-2)^2, r, s) and phi_{n-2}(x) exactly
// represented as F(x; p, q). See the discussion surrounding Eq'n
// (23) of LAWN 89 [CITATION], but keep in mind that we use the
// definitions (a,b,c) corresponding to the standard quadratic
// equation a x^2 + b x + c = 0 rather than the notation of LAWN 89.
const Real bNeg =
(kGap+km1Gap)*state.secular -
kGap*km1Gap*(state.psiMinusDeriv+state.psiOriginDeriv);
const Real c = kGap*km1Gap*state.secular;
eta = SolveQuadraticPlus( a, bNeg, c, ctrl.negativeFix );
}
}
else
{
const Real bNeg =
(kGap+km1Gap)*state.secular -
kGap*km1Gap*(state.psiMinusDeriv+state.psiOriginDeriv);
const Real c = kGap*km1Gap*state.secular;
eta = SolveQuadraticPlus( a, bNeg, c, ctrl.negativeFix );
}
if( state.secular*eta >= zero )
{
// The current update does not move in the right direction, so fall back
// to a small Newton step (as the derivative is likely large).
if( ctrl.progress )
Output("Falling back to Newton step");
eta = -state.secular / (state.psiMinusDeriv+state.psiOriginDeriv);
}
const Real rootRelEstProp = state.rootRelEst + eta;
if( rootRelEstProp > state.rootRelUpperBound ||
rootRelEstProp < state.rootRelLowerBound )
{
if( ctrl.progress )
Output("Stepped out of bounds");
// Move halfway towards the bound instead of exceeding it. Note that
// LAPACK's {s,d}laed4 [CITATION] follows this strategy, but LAPACK's
// {s,d}lasd4 uses trivial upper and lower bounds rather than
// continually updating them.
if( state.secular < zero )
eta = (state.rootRelUpperBound - state.rootRelEst) / 2;
else
eta = (state.rootRelLowerBound - state.rootRelEst) / 2;
}
//.........这里部分代码省略.........
示例5: usage
static void usage( void )
{
ShowProductInfo();
Output( "Usage: dmpobj [options] objfile[" OBJSUFFIX "]..." CRLF );
Output( "Options:" CRLF );
Output( "-l\t\tProduce listing file" CRLF );
Output( "-d\t\tPrint descriptive titles for some output" CRLF );
Output( "-t\t\tPrint names for some index values and list at end" CRLF );
Output( "-c\t\tDump COMENT records without interpretation" CRLF );
Output( "-i\t\tOriginal Intel OMF-86 format" CRLF );
Output( "-q\t\tQuiet, don't show product info" CRLF );
Output( "-r\t\tProvide raw dump of records as well" CRLF );
Output( "-rec=xxx\tProvide dump of selected record type" CRLF );
Output( "\t\t (by number or by symbolic name)" CRLF );
leave( 1 );
}
示例6: RelocateStarportIfUnderwaterOrBuried
//.........这里部分代码省略.........
matrix3x3d rotNotUnderwaterWithLeastVariation = rot;
vector3d posNotUnderwaterWithLeastVariation = pos;
const double heightVariationCheckThreshold = 0.008; // max variation to radius radius ratio to check for local slope, ganymede is around 0.01
const double terrainHeightVariation = planet->GetMaxFeatureRadius(); //in radii
//Output("%s: terrain height variation %f\n", sbody->name.c_str(), terrainHeightVariation);
// 6 points are sampled around the starport center by adding/subtracting delta to to coords
// points must stay within max height variation to be accepted
// 1. delta should be chosen such that it a distance from the starport center that encloses landing pads for the largest starport
// 2. maxSlope should be set so maxHeightVariation is less than the height of the landing pads
const double delta = 20.0/radius; // in radii
const double maxSlope = 0.2; // 0.0 to 1.0
const double maxHeightVariation = maxSlope*delta*radius; // in m
matrix3x3d rot_ = rot;
vector3d pos_ = pos;
bool manualRelocationIsEasy = !(planet->GetSystemBody()->GetType() == SystemBody::TYPE_PLANET_ASTEROID || terrainHeightVariation > heightVariationCheckThreshold);
// warn and leave it up to the user to relocate custom starports when it's easy to relocate manually, i.e. not on asteroids and other planets which are likely to have high variation in a lot of places
const bool isRelocatableIfBuried = !(sbody->IsCustomBody() && manualRelocationIsEasy);
bool isInitiallyUnderwater = false;
bool initialVariationTooHigh = false;
Random r(sbody->GetSeed());
for (int tries = 0; tries < 200; tries++) {
variationWithinLimits = true;
const double height = planet->GetTerrainHeight(pos_) - radius; // in m
// check height at 6 points around the starport center stays within variation tolerances
// GetHeight gives a varying height field in 3 dimensions.
// Given it's smoothly varying it's fine to sample it in arbitary directions to get an idea of how sharply it varies
double v[6];
v[0] = fabs(planet->GetTerrainHeight(vector3d(pos_.x+delta, pos_.y, pos_.z))-radius-height);
v[1] = fabs(planet->GetTerrainHeight(vector3d(pos_.x-delta, pos_.y, pos_.z))-radius-height);
v[2] = fabs(planet->GetTerrainHeight(vector3d(pos_.x, pos_.y, pos_.z+delta))-radius-height);
v[3] = fabs(planet->GetTerrainHeight(vector3d(pos_.x, pos_.y, pos_.z-delta))-radius-height);
v[4] = fabs(planet->GetTerrainHeight(vector3d(pos_.x, pos_.y+delta, pos_.z))-radius-height);
v[5] = fabs(planet->GetTerrainHeight(vector3d(pos_.x, pos_.y-delta, pos_.z))-radius-height);
// break if variation for all points is within limits
double variationMax = 0.0;
for (int i = 0; i < 6; i++) {
variationWithinLimits = variationWithinLimits && (v[i] < maxHeightVariation);
variationMax = (v[i] > variationMax)? v[i]:variationMax;
}
// check if underwater
const bool starportUnderwater = (height <= 0.0);
//Output("%s: try no: %i, Match found: %i, best variation in previous results %f, variationMax this try: %f, maxHeightVariation: %f, Starport is underwater: %i\n",
// sbody->name.c_str(), tries, (variationWithinLimits && !starportUnderwater), bestVariation, variationMax, maxHeightVariation, starportUnderwater);
if (tries == 0) {
isInitiallyUnderwater = starportUnderwater;
initialVariationTooHigh = !variationWithinLimits;
}
if (!starportUnderwater && variationMax < bestVariation) {
bestVariation = variationMax;
posNotUnderwaterWithLeastVariation = pos_;
rotNotUnderwaterWithLeastVariation = rot_;
}
if (variationWithinLimits && !starportUnderwater) break;
// try new random position
const double r2 = r.Double(); // function parameter evaluation order is implementation-dependent
const double r1 = r.Double(); // can't put two rands in the same expression
rot_ = matrix3x3d::RotateZ(2*M_PI*r1)
* matrix3x3d::RotateY(2*M_PI*r2);
pos_ = rot_ * vector3d(0,1,0);
}
if (isInitiallyUnderwater || (isRelocatableIfBuried && initialVariationTooHigh)) {
pos = posNotUnderwaterWithLeastVariation;
rot = rotNotUnderwaterWithLeastVariation;
}
if (sbody->IsCustomBody()) {
const SystemPath &p = sbody->GetPath();
if (initialVariationTooHigh) {
if (isRelocatableIfBuried) {
Output("Warning: Lua custom Systems definition: Surface starport has been automatically relocated. This is in order to place it on flatter ground to reduce the chance of landing pads being buried. This is not an error as such and you may attempt to move the starport to another location by changing latitude and longitude fields.\n Surface starport name: %s, Body name: %s, In sector: x = %i, y = %i, z = %i.\n",
sbody->GetName().c_str(), sbody->GetParent()->GetName().c_str(), p.sectorX, p.sectorY, p.sectorZ);
} else {
Output("Warning: Lua custom Systems definition: Surface starport may have landing pads buried. The surface starport has not been automatically relocated as the planet appears smooth enough to manually relocate easily. This is not an error as such and you may attempt to move the starport to another location by changing latitude and longitude fields.\n Surface starport name: %s, Body name: %s, In sector: x = %i, y = %i, z = %i.\n",
sbody->GetName().c_str(), sbody->GetParent()->GetName().c_str(), p.sectorX, p.sectorY, p.sectorZ);
}
}
if (isInitiallyUnderwater) {
Output("Error: Lua custom Systems definition: Surface starport is underwater (height not greater than 0.0) and has been automatically relocated. Please move the starport to another location by changing latitude and longitude fields.\n Surface starport name: %s, Body name: %s, In sector: x = %i, y = %i, z = %i.\n",
sbody->GetName().c_str(), sbody->GetParent()->GetName().c_str(), p.sectorX, p.sectorY, p.sectorZ);
}
}
}
示例7: readcsPing
void readcsPing(const int client, const int server)
{
(void)client;
(void)server;
Output("\n> 0x%02x ; PONG",OPC_PING);
}
示例8: readcsUpdate
void readcsUpdate(const int client, const int server)
{
(void)client;
(void)server;
Output("\n> 0x%02x ; update request",OPC_UPDATE);
}
示例9: Output
void CLogOutput::Print(int priority, const std::string& text)
{
Output(priority, text.c_str());
}
示例10: SDLInit
string SDLInit(const char *title, const int2 &desired_screensize, bool isfullscreen, int vsync)
{
//SDL_SetMainReady();
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER /* | SDL_INIT_AUDIO*/) < 0)
{
return SDLError("Unable to initialize SDL");
}
SDL_SetEventFilter(SDLHandleAppEvents, nullptr);
Output(OUTPUT_INFO, "SDL initialized...");
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
// on demand now
//extern bool sfxr_init();
//if (!sfxr_init())
// return SDLError("Unable to initialize audio");
#ifdef PLATFORM_ES2
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
#else
//certain older Intel HD GPUs and also Nvidia Quadro 1000M don't support 3.1 ? the 1000M is supposed to support 4.2
//SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
//SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
#ifdef __APPLE__
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG);
#elif defined(_WIN32)
//SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 4);
//SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
//SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
#endif
#if defined(__APPLE__) || defined(_WIN32)
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
#endif
#endif
//SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); // set this if we're in 2D mode for speed on mobile?
SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1); // because we redraw the screen each frame
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
Output(OUTPUT_INFO, "SDL about to figure out display mode...");
#ifdef PLATFORM_ES2
landscape = desired_screensize.x() >= desired_screensize.y();
int modes = SDL_GetNumDisplayModes(0);
screensize = int2(1280, 720);
for (int i = 0; i < modes; i++)
{
SDL_DisplayMode mode;
SDL_GetDisplayMode(0, i, &mode);
Output(OUTPUT_INFO, "mode: %d %d", mode.w, mode.h);
if (landscape ? mode.w > screensize.x() : mode.h > screensize.y())
{
screensize = int2(mode.w, mode.h);
}
}
Output(OUTPUT_INFO, "chosen resolution: %d %d", screensize.x(), screensize.y());
Output(OUTPUT_INFO, "SDL about to create window...");
_sdl_window = SDL_CreateWindow(title,
0, 0,
screensize.x(), screensize.y(),
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_BORDERLESS);
Output(OUTPUT_INFO, _sdl_window ? "SDL window passed..." : "SDL window FAILED...");
if (landscape) SDL_SetHint("SDL_HINT_ORIENTATIONS", "LandscapeLeft LandscapeRight");
int ax = 0, ay = 0;
SDL_GetWindowSize(_sdl_window, &ax, &ay);
int2 actualscreensize(ax, ay);
//screenscalefactor = screensize.x / actualscreensize.x; // should be 2 on retina
#ifdef __IOS__
assert(actualscreensize == screensize);
screensize = actualscreensize;
#else
screensize = actualscreensize; // __ANDROID__
Output(OUTPUT_INFO, "obtained resolution: %d %d", screensize.x(), screensize.y());
#endif
#else
screensize = desired_screensize;
_sdl_window = SDL_CreateWindow(title,
SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
screensize.x(), screensize.y(),
SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE |
(isfullscreen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0));
#endif
if (!_sdl_window)
return SDLError("Unable to create window");
Output(OUTPUT_INFO, "SDL window opened...");
_sdl_context = SDL_GL_CreateContext(_sdl_window);
//.........这里部分代码省略.........
示例11: ASM
static ASM(void) errfunc(REG(d0, UBYTE c), REG(a3, xadUINT32 pd))
{
UBYTE d = c;
if(c)
Write(Output(), &d, 1);
}
示例12: OutRecordsDsbl
void OutRecordsDsbl(void)
{
InitPushCRC();
Push(&mpfRecordDsbl, sizeof(mpfRecordDsbl));
Output(sizeof(mpfRecordDsbl));
}
示例13: Input
Controler::Controler(){
in = Input();
com = Computer();
out = Output();
eh = ExceptionHandler();
}
示例14: readscPing
void readscPing(const int server, const int client)
{
(void)client;
(void)server;
Output("\n< 0x%02x ; PING",OPC_PING);
}
示例15: Output
void DumpVisitor::PutIndent() const
{
for (unsigned int i = 0; i < m_level; i++)
Output(" ");
}