예제 #1
0
void InlinedScope::markLocalsDebugVisible(GrowableArray<PReg*>* exprStack) {
  // this scope has at least one send - mark params & locals as debug-visible
  int i;
  if (_nofSends <= 1) {
    // first time we're called
    self()->preg()->debug = true;
    for (i = nofArguments() - 1; i >= 0; i--) {
      argument(i)->preg()->debug = true;
    }
    for (i = nofTemporaries() - 1; i >= 0; i--) {
      temporary(i)->preg()->debug = true;
    }
    // if there's a context, mark all context variables as debug-visible too.
    GrowableArray<Expr*>*  ct = contextTemporaries();
    if (ct != NULL) {
      for (i = 0; i < ct->length(); i++) {
        ct->at(i)->preg()->debug = true;
      }
    }
  }
  // also mark expression stack as debug-visible (excluding arguments to
  // current send) (the args are already excluded from the CallNode's
  // expression stack, so just use that one instead of this->exprStack)
  for (i = 0; i < exprStack->length(); i++) {
    exprStack->at(i)->debug = true;
  }
}
예제 #2
0
    Vector Quaternion::apply(const Vector &vector) const
    {
        Quaternion temporary(vector.x, vector.y, vector.z, 0.0f);

        temporary = temporary * this->conjugate();
        temporary = *this * temporary;

        return Vector(temporary.x, temporary.y, temporary.z);
    }
예제 #3
0
void
MyInsert::visit ( SgNode* astNode )
{

 if(SgIfStmt * ifst=isSgIfStmt(astNode))
   {
   printf("found If stmt\n");
   Sg_File_Info *finfo=new Sg_File_Info(CURRENT_FILE, 1, 1);
   SgName temporary("temp");
   SgVariableDeclaration * stmt=new SgVariableDeclaration(finfo, 
temporary, new SgTypeInt());
   //SgReturnStmt * stmt=new SgReturnStmt(finfo);
   SgStatement * bb=ifst->get_scope();
   bb->insert_statement(ifst, stmt, TRUE);
  }
}
예제 #4
0
CCustomer::~CCustomer()
{
// drop #temporary table
    QString query ("DROP TABLE #GroupCustomerDiscounts"
                   "DROP TABLE #CustomerSubdiller");
    QSqlQuery temporary(currentDatabase());
    temporary.exec(query);

    if (IS_VALID_PTR(focusedWidget))        { delete focusedWidget;            focusedWidget  = nullptr;   }

    if (IS_VALID_PTR(customerDialog))       { delete customerDialog;           customerDialog = nullptr;   }
    if (IS_VALID_PTR(discountDialog))       { delete discountDialog;           discountDialog = nullptr;   }
    if (IS_VALID_PTR(customer_gDialog))     { delete customer_gDialog;         customer_gDialog = nullptr; }

    if (IS_VALID_PTR(ui))                   { delete ui;                       ui             = nullptr;   }
}
예제 #5
0
const Array <T> & Array <T>::operator = (const Array & rhs)
{
	if(this != &rhs) 
	{
		delete [] this->data_;
		Array temporary(rhs);
		this->data_= new T[temporary.cur_size_];

		this->cur_size_=temporary.cur_size_;
		this->max_size_=temporary.max_size_;
		
		std::copy(temporary.data_,temporary.data_+temporary.cur_size_,this->data_);
		
	}
	return *this;
  
}
예제 #6
0
/*!
   \param message Warning message that is shown to the user.
   \param windowTitle The title that has the message box.
   \param icon The icon to show.
*/
void TSystem::showMsgBox(const QString &message, const QString &windowTitle, QMessageBox::Icon icon) const
{
   QDEBUG_METHOD_NAME;

   if (qApp == NULL)
   {
        // To show a Qt dialog we need a QApplication
        int argc = 0;
        char **argv = NULL;
        QApplication temporary(argc, argv);
        showMsgBoxWhenHavingQApp(message, windowTitle, icon);
        // Let's notice that the life of the temporary QApplication finishes at the end of this block
   }
   else
   {
        showMsgBoxWhenHavingQApp(message, windowTitle, icon);
   }
}
int fortosi_progress_1_2::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: startread(); break;
        case 1: scan(); break;
        case 2: finalize(); break;
        case 3: temporary(); break;
        case 4: back(); break;
        case 5: delrow(); break;
        case 6: cellclicked(); break;
        default: ;
        }
        _id -= 7;
    }
    return _id;
}
예제 #8
0
int fortosi_new_1_1::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QDialog::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: scan(); break;
        case 1: finalize(); break;
        case 2: temporary(); break;
        case 3: back(); break;
        case 4: cellclicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 5: delrow(); break;
        case 6: check(); break;
        case 7: compare(); break;
        case 8: startread(); break;
        default: ;
        }
        _id -= 9;
    }
    return _id;
}
예제 #9
0
 compressed_vector& operator = (vector_expression<AE> const& ae) {
     self_type temporary(ae, nnz_capacity());
     swap(temporary);
     return *this;
 }
	/**
	 *  @brief リストのマージ
	 *
	 *  リストの終端にリストtを追加する。
	 *    - 時間計算量: \f$ O(m + \log{(n+m)}) \f$
	 *
	 *  @param[in] t  結合するリスト
	 */
	void merge(const LazyTreapList<Traits> &t){
		LazyTreapList<Traits> temporary(t);
		merge(std::move(temporary));
	}
예제 #11
0
Tree call(Tree f, Type fty, Coordinate src) {
	int n = 0;
	Tree args = NULL, r = NULL, e;
	Type *proto, rty = unqual(freturn(fty));
	Symbol t3 = NULL;

	if (fty->u.f.oldstyle)
		proto = NULL;
	else
		proto = fty->u.f.proto;
	if (hascall(f))
		r = f;
	if (isstruct(rty))
		{
			t3 = temporary(AUTO, unqual(rty));
			if (rty->size == 0)
				error("illegal use of incomplete type `%t'\n", rty);
		}
	if (t != ')')
		for (;;) {
			Tree q = pointer(expr1(0));
			if (proto && *proto && *proto != voidtype)
				{
					Type aty;
					q = value(q);
					aty = assign(*proto, q);
					if (aty)
						q = cast(q, aty);
					else
						error("type error in argument %d to %s; found `%t' expected `%t'\n", n + 1, funcname(f),

							q->type, *proto);
					if ((isint(q->type) || isenum(q->type))
					&& q->type->size != inttype->size)
						q = cast(q, promote(q->type));
					++proto;
				}
			else
				{
					if (!fty->u.f.oldstyle && *proto == NULL)
						error("too many arguments to %s\n", funcname(f));
					q = value(q);
					if (isarray(q->type) || q->type->size == 0)
						error("type error in argument %d to %s; `%t' is illegal\n", n + 1, funcname(f), q->type);

					else
						q = cast(q, promote(q->type));
				}
			if (!IR->wants_argb && isstruct(q->type))
				if (iscallb(q))
					q = addrof(q);
				else {
					Symbol t1 = temporary(AUTO, unqual(q->type));
					q = asgn(t1, q);
					q = tree(RIGHT, ptr(t1->type),
						root(q), lvalue(idtree(t1)));
				}
			if (q->type->size == 0)
				q->type = inttype;
			if (hascall(q))
				r = r ? tree(RIGHT, voidtype, r, q) : q;
			args = tree(mkop(ARG, q->type), q->type, q, args);
			n++;
			if (Aflag >= 2 && n == 32)
				warning("more than 31 arguments in a call to %s\n",
					funcname(f));
			if (t != ',')
				break;
			t = gettok();
		}
	expect(')');
	if (proto && *proto && *proto != voidtype)
		error("insufficient number of arguments to %s\n",
			funcname(f));
	if (r)
		args = tree(RIGHT, voidtype, r, args);
	e = calltree(f, rty, args, t3);
	if (events.calls)
		apply(events.calls, &src, &e);
	return e;
}
예제 #12
0
	vector &operator -= (const vector_expression<AE> &ae) {
		self_type temporary(*this - ae);
		return assign_temporary(temporary);
	}
예제 #13
0
void Grid::formGrid(char * filename) {
	// reads the grid into words and chars
	std::ifstream myfile;
	myfile.open(filename);
	std::cout << "Loading Grid from " << filename << std::endl;
	std::string temp;
	std::stringstream temp_ss;
	char temp_c;

	// read size
	getline(myfile, temp);
	temp_ss.str(temp.substr(14, temp.size() - 14));
	temp_ss >> sizex >> temp_c>> sizey;
	std::cout << "size: " << sizex << "x" << sizey << std::endl;

	// read the grid and store it in the CharSpace vector
	// this is slow when the files are large..... it might be worth reading one line at a time.
	while (myfile.good()){
		myfile >> temp_c;
		CharSpace temp_CharSpace(temp_c);
		mychars.push_back(temp_CharSpace);
	}
	myfile.close();
	std::cout << "Grid read into memory" << std::endl;
	
	// Search the array to create new word objects.
	char current, last;
	std::vector<CharSpace*> temp_content; // use typedef
	last = '#';
	std::cout << "finding horizontal words " << std::endl;
	for (int ii = 0; ii < sizey; ii++){
		for (int jj = 0; jj < sizex; jj++){
			current = mychars[ii*sizex + jj].getChar();
			if (current == '_'){
				if (last == '#'){
					// new word starts here
					temp_content.clear();
				}
				temp_content.push_back(&mychars[ii*sizex + jj]);
				mychars[ii*sizex + jj].getWordVector()->push_back(mywords.size() - 1);
			} else { // current == '#'
				if (last == '_' && temp_content.size() > 1){ // word ends here. Store only words of zise > 1 
					Word temporary(temp_content, &myDics[temp_content.size()]);
					mywords.push_back(temporary);		
				} // else found two # in a row. Continue
			}
			last = current;
		}
		// line ends, hence the word ends as well
		if (last == '_' && temp_content.size() > 1){ // word ends here. Store only words of zise > 1 
			Word temporary(temp_content, &myDics[temp_content.size()]);
			mywords.push_back(temporary);
		}
		temp_content.clear();
		last = '#'; // pretend we start the row from a #
	}

	std::cout << "finding vertical words" << std::endl;
	for (int jj = 0; jj < sizex; jj++){
		for (int ii = 0; ii < sizey; ii++){
			current = mychars[ii*sizex + jj].getChar();
			if (current == '_'){
				if (last == '#'){
					// word starts here
					temp_content.clear();
				}
				temp_content.push_back(&mychars[ii*sizex + jj]);
				mychars[ii*sizex + jj].getWordVector()->push_back(mywords.size() - 1);
			}
			else { // current == '#'
				if (last == '_' && temp_content.size() > 1){ // word ends here. Store only words of zise > 1 
					Word temporary(temp_content, &myDics[temp_content.size()]);
					mywords.push_back(temporary);
				} // else found two # in a row. Continue
			}
			last = current;
		}
		// column ends
		if (last == '_' && temp_content.size() > 1){ // word ends here. Store only words of zise > 1 
			Word temporary(temp_content, &myDics[temp_content.size()]);
			mywords.push_back(temporary);
		}
		temp_content.clear();
		last = '#'; // pretend we start the row from a #
	}

	std::cout << "total words found " << mywords.size() << std::endl;
}
예제 #14
-1
CCustomer::CCustomer(QWidget *parent) :
    QWidget(parent)
  , actualRecords(false)
  , ui(new Ui::CCustomer)
  , customerDialog(new CCustomerDialog(this)), customer_gDialog(new CCustomer_gDialog(this))
  , discountDialog(new CDiscountDialog(this))
  , addItem(new CAddItem(this))
  , focusedWidget(nullptr)
{
    ui->setupUi(this);

// model
    modelFaces    = new QStandardItemModel(this);
    modelPartner  = new QStandardItemModel(this);
    modelHuman    = new QStandardItemModel(this);

    modelSelectionFaces   = new QItemSelectionModel(modelFaces);
    modelSelectionPartner = new QItemSelectionModel(modelPartner);
    modelSelectionHuman   = new QItemSelectionModel(modelHuman);

// create #temporary table
    QString query ("SELECT * INTO #GroupCustomerDiscounts FROM ViewGroupCustomerDiscounts"
                   "SELECT * INTO #CustomerSubdiller FROM ViewCustomerSubdiller");
    QSqlQuery temporary(currentDatabase());
    temporary.exec(query);

    QSplitter *hSplitter = new QSplitter(Qt::Horizontal);
    QSplitter *vSplitter = new QSplitter(Qt::Vertical);

    QWidget *w1 = new QWidget(this);
    QWidget *w2 = new QWidget(this);

    treeFaces          = new QTreeView (this);
    treePartner        = new CCustomerTreeView (this);
    textEditPartnerComment = new QTextEdit (this);
    textEditPartnerComment->setMaximumWidth(100);
    textEditPartnerComment->setReadOnly(true);
    treeHuman          = new CCustomerTreeView (this);
    textEditHumanComment   = new QTextEdit (this);
    textEditHumanComment->setMaximumWidth(100);
    textEditHumanComment->setReadOnly(true);

    QHBoxLayout *hboxPartner = new QHBoxLayout(w1);
                 hboxPartner->setMargin(0);
                 hboxPartner->addWidget(treePartner);
                 hboxPartner->addWidget(textEditPartnerComment);

    QHBoxLayout *hboxHuman = new QHBoxLayout(w2);
                 hboxHuman->setMargin(0);
                 hboxHuman->addWidget(treeHuman);
                 hboxHuman->addWidget(textEditHumanComment);

    vSplitter->addWidget(w1);
    vSplitter->addWidget(w2);
    vSplitter->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);

    ui->vLayoutUnionPartnerHuman->addWidget(vSplitter);

    hSplitter->addWidget(treeFaces);
    hSplitter->addWidget(vSplitter);
    hSplitter->setStretchFactor(1, 3);
    hSplitter->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);

    ui->hLayoutUnionViews->addWidget(hSplitter);

    treeFaces->setObjectName("treeViewFaces");
    treeFaces->setModel(modelFaces);
    treeFaces->setSelectionModel(modelSelectionFaces);
    treeFaces->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeFaces->installEventFilter(this);

    treePartner->setObjectName("treeViewPartner");
    treePartner->setRootIsDecorated(false);
    treePartner->setAlternatingRowColors(true);
    treePartner->setModel(modelPartner);
    treePartner->setSelectionModel(modelSelectionPartner);
    treePartner->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treePartner->installEventFilter(this);

    treeHuman->setObjectName("treeViewHuman");
    treeHuman->setRootIsDecorated(false);
    treeHuman->setAlternatingRowColors(true);
    treeHuman->setModel(modelHuman);
    treeHuman->setSelectionModel(modelSelectionHuman);
    treeHuman->setEditTriggers(QAbstractItemView::NoEditTriggers);
    treeHuman->installEventFilter(this);

    filter = new CFilter(this);
    filter->setObjectName("filter");
    filter->setPlaceholderText("Введите наименование");
    filter->installEventFilter(this);
    filter->setValidator(new QRegExpValidator(QRegExp(trUtf8("[а-яА-Яa-zA-Z0-9_]+")), this));
    ui->hLayoutSearchToItem->addWidget(filter);

    QToolButton *telephone = new QToolButton(this);
    QPixmap pixmapTelephone("data/picture/additionally/telephone.png");

    telephone->setIcon(QIcon(pixmapTelephone));
    telephone->setIconSize(QSize(24, 24));
    telephone->setCursor(Qt::PointingHandCursor);
    telephone->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(telephone);

    QToolButton *meeting = new QToolButton(this);
    QPixmap pixmapMeeting("data/picture/additionally/meeting.png");

    meeting->setIcon(QIcon(pixmapMeeting));
    meeting->setIconSize(QSize(24, 24));
    meeting->setCursor(Qt::PointingHandCursor);
    meeting->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(meeting);

    QToolButton *event = new QToolButton(this);
    QPixmap pixmapEvent("data/picture/additionally/event.png");

    event->setIcon(QIcon(pixmapEvent));
    event->setIconSize(QSize(24, 24));
    event->setCursor(Qt::PointingHandCursor);
    event->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(event);

    QToolButton *task = new QToolButton(this);
    QPixmap pixmapTask("data/picture/additionally/task.png");

    task->setIcon(QIcon(pixmapTask));
    task->setIconSize(QSize(24, 24));
    task->setCursor(Qt::PointingHandCursor);
    task->setStyleSheet("QToolButton { border: none; padding: 0px; }");
    ui->hLayoutSearchToItem->addWidget(task);

    ui->labelCurrentUser->setText(QString("Пользователь: <b><u>" + currentUser() + "</u></b>"));

    mc.idCustomer      = -1;
    mc.nameCustomer    = QString("");

    root = new QStandardItem(QString("Заказчики"));
    root->setIcon(QIcon("data/picture/additionally/root.png"));
    modelFaces->insertColumns(0, FACES_MODEL_COLUMN_COUNT);
    modelFaces->setItem(0, 0, root);

    QFont font(treeFaces->font());
          font.setBold (true);
    modelFaces->setData(modelFaces->index(0, 0), font, Qt::FontRole);
    modelFaces->setHeaderData(0, Qt::Horizontal, QObject::tr("Наименование"));

    QVector<int> storage;
                 storage.append(1);
                 storage.append(2);
                 storage.append(3);
    CDictionaryCore::columnHidden(treeFaces, modelFaces, storage);
                 storage.clear();

    root->setChild(modelFaces->rowCount(root->index()), new QStandardItem("Загрузка..."));

    modelPartner->insertColumns(0, PARTNER_MODEL_COLUMN_COUNT);

    modelPartner->setHeaderData(0, Qt::Horizontal, "Контрагенты");
    modelPartner->setHeaderData(1, Qt::Horizontal, "Клиентский №");
    modelPartner->setHeaderData(2, Qt::Horizontal, "Телефон");
    modelPartner->setHeaderData(3, Qt::Horizontal, "Город");
    modelPartner->setHeaderData(4, Qt::Horizontal, "Web");
    modelPartner->setHeaderData(5, Qt::Horizontal, "Руководитель");

    modelHuman->insertColumns(0, HUMAN_MODEL_COLUMN_COUNT);

    modelHuman->setHeaderData(0, Qt::Horizontal, "ФИО");
    modelHuman->setHeaderData(1, Qt::Horizontal, "Отдел");
    modelHuman->setHeaderData(2, Qt::Horizontal, "Должность");
    modelHuman->setHeaderData(3, Qt::Horizontal, "Телефон");
    modelHuman->setHeaderData(4, Qt::Horizontal, "Приоритет");

//    connect(filter, SIGNAL(textChanged(QString)), SLOT(slotFindCities(QString)));
    connect(treeFaces, SIGNAL(expanded(QModelIndex)),  SLOT(slotFillGroup(QModelIndex)));
    connect(treeFaces, SIGNAL(collapsed(QModelIndex)), SLOT(slotClearGroup(QModelIndex)));
    connect(treeFaces, SIGNAL(clicked(QModelIndex)),   SLOT(slotFillPartner(QModelIndex)));

//    connect(treeViewCountry, SIGNAL(clicked(QModelIndex)),
//            this, SLOT(slotDataChanged(QModelIndex)));
//    connect(editDialogCountry, SIGNAL(saveDataChanged()), this, SLOT(slotInsertOrUpdateRecords()));
//    connect(editDialogCity, SIGNAL(saveDataChanged()), this, SLOT(slotInsertOrUpdateRecords()));
//    connect(addItem->ui->buttonSave, SIGNAL(clicked()), countryDialog, SLOT(show()));

    connect(addItem->ui->buttonSave, SIGNAL(clicked()), SLOT(slotShowEditDialog()));
    connect(addItem->ui->buttonSave, SIGNAL(clicked()), addItem, SLOT(close()));

    actualRecords
             ? ui->labelViewState->setText(QString(tr("Отображаются записи: <b><u>Актуальные</u></b>")))
             :
               ui->labelViewState->setText(QString(tr("Отображаются записи: <b><u>Все</u></b>")));
}