本文整理汇总了C++中Gate类的典型用法代码示例。如果您正苦于以下问题:C++ Gate类的具体用法?C++ Gate怎么用?C++ Gate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Gate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gate
void Circuit::dumpCircuit()
{
cout<<endl;
cout<<" Gate Name\tGate Level"<<endl;
cout<<"========================================="<<endl;
for( unsigned i = 0; i< numGate(); ++i )
{
Gate g = gate( i );
cout<< " " << g.name() << '\t' ;
cout<< g.level() << '\t' ;
//cout<< bitset<32>( value[i] ) <<'\t';
cout<< endl;
}
cout<<endl;
cout<<" WireID\tWire Name\tType \tValue"<<endl;
cout<<"======================================================================================="<<endl;
for( unsigned j = 0; j< numWire(); ++j )
{
Wire w = wire( j );
cout<< " "<< j << "\t\t";
cout<< w.name() << "\t\t";
cout<< setiosflags(ios::left) << setw(8) << w.type() <<'\t';
if( w.type() != "UNUSED" )
cout<< bitset<32>( w.valueSet() )<<'\t';
else
cout<<"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"<<'\t';
cout<<endl;
}
}
示例2: print_io
bool CirMgr::print_io(){
cout << "========= PRINT_IO =========" << endl;
cout << "GATE:" << endl;
for(size_t i=0 ; i<GateList[0].size() ; ++i){
cout << "(" << i << ")";
cout << " ID = " << GateList[0][i]->getId();
cout << ", Type = " << GateList[0][i]->getType();
cout << ", Fanin0 = " << GateList[0][i]->getFin0()->getId();
if(GateList[0][i]->getFin1()!=0)
cout << ", Fanin1 = " << GateList[0][i]->getFin1()->getId();
cout << ", Fanout = " << GateList[0][i]->getFout()->getId();
cout << endl;
}
cout << "WIRE: " << endl;
for(size_t i=0 ; i<WireList[0].size() ; ++i){
cout << "(" << i << ")";
cout << " ID = " << WireList[0][i]->getId();
if(WireList[0][i]->getFin()!=0){
cout << ", Fanin = " << WireList[0][i]->getFin()->getId() << " (";
Gate* gate = WireList[0][i]->getFin();
cout << " " << gate->getFin0()->getId();
if(gate->getFin1()!=0)
cout << " " << gate->getFin1()->getId();
cout << " )";
}
cout << endl;
}
cout << endl;
return true;
}
示例3: tracker_thunk
ACE_THR_FUNC_RETURN Gate::
tracker_thunk (void* arg)
{
Gate* a = reinterpret_cast<Gate*> (arg);
a->tracker ();
return 0;
}
示例4: CreateGate
static void CreateGate( int flag, const AcDbObjectId& host, const AcGePoint3d& pt, double angle )
{
Gate* pGate;
switch( flag )
{
case 1:
pGate = new PermanentGate( pt, angle ); // 永久风门
break;
case 2:
pGate = new TemporaryGate( pt, angle ); // 临时风门
break;
case 3:
pGate = new DoubleGate( pt, angle ); // 双向风门
break;
case 4:
pGate = new BalanceGate( pt, angle ); // 平衡风门
break;
default:
pGate = 0;
}
if( pGate == 0 ) return;
pGate->setRelatedGE( host );
if( !ArxUtilHelper::PostToModelSpace( pGate ) ) delete pGate;
}
示例5: FaultActivate
bool Atpg::FaultActivate() { // TODO: TDF support
Gate *fg = &cir_->gates_[current_fault_->gate_];
int fline = current_fault_->line_;
if (fline) { // input stuck fault on GUT.
Value v = impl_->GetVal(fg->fis_[fline-1]);
if (v==X) { // faulted input at X?
Value objv = (current_fault_->type_==Fault::SA0
|| current_fault_->type_==Fault::STR)?H:L;
current_obj_.first = fg->fis_[fline-1];
current_obj_.second = objv;
}
else {
Value objv = fg->getOutputCtrlValue();
if (objv==X) assert(0); //NOT, PO, PPO, TODO: XOR, XNOR
current_obj_.first = fg->id_;
current_obj_.second = objv;
return true;
}
}
else {
Value objv = (current_fault_->type_==Fault::SA0
|| current_fault_->type_==Fault::STR)?H:L;
current_obj_.first = fg->id_;
current_obj_.second = objv;
return true;
}
}
示例6: NOT_NULL
void FileStreamerThread::processQuit(volatile Request *request)
{
NOT_NULL(request);
ExitChain::quit();
Gate *gate = request->gate;
delete request;
gate->open();
}
示例7: textcolor
void RadarScreen::Refresh() {
int x, y;
EifIterator GateIt;
EifIterator FlightPathIt;
EifIterator AtLandmarkIt;
Gate *CrntGate;
AtLandmark *CrntAtLndmrk;
FlightPath *CrntFlightPath;
//Draw Boundary
window
(
winleft_c - POSITION_WIDTH,
wintop_c - POSITION_HEIGHT,
winright_c + POSITION_WIDTH,
winbottom_c + POSITION_HEIGHT
);
textcolor (BOUNDARY_TEXT_COLOUR);
textbackground (BOUNDARY_BACK_COLOUR);
clrscr();
// DrawGates
GateIt = Gates_c.Iterator();
while (!GateIt.Finished()) {
CrntGate = Gates_c.Item (GateIt);
x = CrntGate->GrndPos().X() * POSITION_WIDTH + 1;
if (CrntGate->GrndPos().X() == MAX_X) {
x++;
}
y = (MAX_Y - CrntGate->GrndPos().Y() + 1) * POSITION_HEIGHT;
gotoxy (x, y);
cprintf (PRINT_GATE);
cprintf ("%d", CrntGate->ID());
GateIt.Forth();
}
// Draw radar screen
Select();
clrscr();
for (x = MIN_FIELD_X; x <= MAX_FIELD_X; x++) {
for (y = MIN_FIELD_Y; y <= MAX_FIELD_Y; y++) {
PrintBackPosition (Position (x,y));
}
assert (True);
}
}
示例8: lua_pushGate
void lua_pushGate( lua_State* L, const Gate& g )
{
lua_newtable ( L );
lua_pushnumber ( L, g.getMean() );
lua_setfield ( L, -2, "mean" );
lua_pushnumber ( L, g.getStdDev() );
lua_setfield ( L, -2, "stdDev" );
lua_pushinteger( L, g.getSource() );
lua_setfield ( L, -2, "source" );
lua_pushinteger( L, g.getID() );
lua_setfield ( L, -2, "id" );
}
示例9: SetImage
Gate::Gate(Coordinate pos) {
top = true;
SetImage( Image::Get("Resources/Graphics/gate1_top.png") );
// Create the PartnerID Gate
Gate* partner = new Gate(this->GetID());
partnerID = partner->GetID();
exitID = 0;
SpriteManager::Instance()->Add((Sprite*)partner);
// Set both Position and Angle at the same time
SetWorldPosition(pos);
SetAngle( float( rand() %360 ) );
}
示例10: CrntColumn_c
ATCInput::ATCInput (Traffic *Traff_i, Landmarks *Lmarks_i) :
//Screen initialisations
ATCScreen
(
1,
46,
60,
50,
ATC_TEXT_MODE,
BLACK,
WHITE
),
CrntColumn_c (1),
Traff_c (Traff_i),
Gates_c (True),
Airports_c (True),
Beacons_c (True),
NextProcess_c (&GetPlane),
IsCmndToCollect_c (False),
LastCmnd_c (NULL)
{
int GateIx, AirportIx, BeaconIx;
Gate *CrntGate;
Airport *CrntAirport;
Beacon *CrntBeacon;
for (GateIx = 0; GateIx < Lmarks_i->NoOfGates(); GateIx++) {
CrntGate = Lmarks_i->AllGates() [GateIx];
Gates_c.Add (CrntGate, CrntGate->ID());
}
for (AirportIx = 0; AirportIx < Lmarks_i->NoOfAirports(); AirportIx++) {
CrntAirport = Lmarks_i->AllAirports() [AirportIx];
Airports_c.Add (CrntAirport, CrntAirport->ID());
}
for (BeaconIx = 0; BeaconIx < Lmarks_i->NoOfBeacons(); BeaconIx++) {
CrntBeacon = Lmarks_i->AllBeacons() [BeaconIx];
Beacons_c.Add (CrntBeacon, CrntBeacon->ID());
}
}
示例11: evalGates
void PWSCircuit::
evalGates(const vector<int>& start, const vector<int>& end)
{
// We don't deal with input gates.
for (size_t lNum= 1; lNum < end.size(); lNum++)
{
CircuitLayer& prevLayer = getGatePosLayer(lNum - 1);
CircuitLayer& layer = getGatePosLayer(lNum);
int gNumStart = start.size() > lNum ? start[lNum] : 0;
for (int gNum = gNumStart; gNum < end[lNum]; gNum++)
{
Gate rop = layer.gate(gNum);
rop.computeGateValue(prevLayer.gate(rop.wiring.in1), prevLayer.gate(rop.wiring.in2));
}
}
}
示例12: SetImage
/**\brief Creates a Top Gate as well as a Bottom Gate automatically
* \todo Remove the SpriteManager Instance access.
*/
Gate::Gate(Coordinate pos, string _name) {
top = true;
SetImage( Image::Get("Resources/Graphics/gate1_top.png") );
// Create the PartnerID Gate
Gate* partner = new Gate(GetID());
partnerID = partner->GetID();
exitID = 0;
SpriteManager::Instance()->Add((Sprite*)partner);
// Set both Position and Angle at the same time
SetWorldPosition(pos);
SetAngle( float( rand() %360 ) );
if( _name == "" ) {
stringstream val_ss;
val_ss << GetID();
val_ss >> _name;
}
示例13: calcOutput
int calcOutput()
{
Gate* ptr = pHead;
while( ptr != null )
{
for( int i = 0; i < ptr->numInputs; i++ )
{
if( ptr->pInputs[i]->isDefined == DEFINED_BY_CALC )
{
ptr->pInputs[i]->isDefined = NOT_DEFINED;
}
}
ptr = ptr->nextGate;
}
int dummy; // TODO : Overload GetID func
Gate* outputGate = getGateIDFromSerial(outputSerial, &dummy);
return outputGate->GetOutput();
}
示例14: computeDelay
int Net::computeDelay()
{
if(drivers->size() == 0) {
return 0; // Input gate
}
int cumulativeMaxVal = 0;
for(vector<Gate*>::iterator it=drivers->begin(); it!=drivers->end(); it++) {
Gate *g = *it;
// Find max values of the gate's nets
int maxVal = 0;
for(vector<Net*>::iterator jt=g->getInputs()->begin(); jt!=g->getInputs()->end(); jt++) {
maxVal = max(maxVal, (*jt)->computeDelay());
}
cumulativeMaxVal = max(cumulativeMaxVal, maxVal + g->getDelay());
}
return cumulativeMaxVal;
}
示例15: if
/* Detects the destination component of the connection */
bool AddConnection::DetectDestinationComponent() {
Component* comp = mAppManager->GetOutput()->GetComponentAtPin(mGfxInfo.x2, mGfxInfo.y2);
if (comp == NULL || comp == mSrcPin->GetGate()) {
return false;
}
else if (dynamic_cast<Gate*>(comp) != NULL) {
Gate* gate = (Gate*)comp;
mDstPinIndex = gate->GetInputPinIndex(mGfxInfo.x2, mGfxInfo.y2);
gate->GetInputPinCoordinates(mGfxInfo.x2, mGfxInfo.y2, mDstPinIndex);
mDstPin = gate->GetInputPin(mDstPinIndex);
if (mDstPin == NULL || mDstPin->IsFull()) {
return false;
}
return true;
}
return false;
}