Esempio n. 1
0
const char *MSIntTableColumn::formatOutput(MSString &buffer_,unsigned row_) 
{
  if (MSView::model()!=0)
   {
     MSInt aInt(vector()(row_));
     aInt.format(buffer_,format());
   }
  return buffer_.string();
}
Esempio n. 2
0
File: main.c Progetto: zhuyadong/COS
int main(int argc, char **argv)
{
	cos_init();
	{
		OBJ map = aMap();
		I32 count = argc < 2 ? 33 : atoi(argv[1]);
		for (U32 i=0; i<count; ++i) {
			gputAt(map, aInt(i), aInt(i));
		}
		for (U32 i=0; i<count; i+=2) {
			gputAt(map, aInt(i), aInt(999999));
		}
		{
			I32 i555 = gint(ggetAt(map, aInt(30)));
			I32 i556 = gint(ggetAt(map, aInt(31)));
			printf("555=%d 556=%d\n", i555, i556);
		}
	}
	return 0;
}
Esempio n. 3
0
  return vw;
}

// ----- view constructors

defalias (OBJ, (ginitWith2)gnewWith2, mView, T, Slice);
defmethod(OBJ,  ginitWith2          , mView, T, Slice) // vector view
  retmethod(ginitWith3(galloc(TV),_2,_3,aInt(NO)));
endmethod

defalias (OBJ, (ginitWith2)gnewWith2, mView, T, Range);
defmethod(OBJ,  ginitWith2          , mView, T, Range) // vector view
  struct Slice *slice = Slice_fromRange(atSlice(0), self3, &self2->size);
  
  retmethod(ginitWith3(galloc(TV),_2,(OBJ)slice,aInt(NO)));
endmethod

defalias (OBJ, (ginitWith2)gnewWith2, mSubView, T, Slice);
defmethod(OBJ,  ginitWith2          , mSubView, T, Slice) // vector view
  retmethod(ginitWith3(galloc(TW),_2,_3,aInt(YES)));
endmethod

defalias (OBJ, (ginitWith2)gnewWith2, mSubView, T, Range);
defmethod(OBJ,  ginitWith2          , mSubView, T, Range) // vector view
  struct Slice *slice = Slice_fromRange(atSlice(0), self3, &self2->size);

  retmethod(ginitWith3(galloc(TW),_2,(OBJ)slice,aInt(YES)));
endmethod

defmethod(OBJ, ginitWith3, TV, T, Slice, Int) // vector view
Esempio n. 4
0
#error "this template file requires tmpl/Vector.c"
#endif

// -----

makclass(TL, TD);

// -----

useclass(TL);

// ----- constructors

defalias (OBJ, (ginitWith)gnewWith, TP, Functor);
defmethod(OBJ,  ginitWith         , TP, Functor) // generator
  retmethod(ginitWith3(galloc(TL),_2,aTRef(0,0),aInt(0)));
endmethod

defalias (OBJ, (ginitWith2)gnewWith2, TP, Functor, T);
defmethod(OBJ,  ginitWith2          , TP, Functor, T) // generator
  retmethod(ginitWith3(galloc(TL),_2,_3,aInt(self3->size*2)));
endmethod

defalias (OBJ, (ginitWith2)gnewWith2, TP, Functor, Int);
defmethod(OBJ,  ginitWith2          , TP, Functor, Int) // generator
  retmethod(ginitWith3(galloc(TL),_2,aTRef(0,0),_3));
endmethod

defalias (OBJ, (ginitWith3)gnewWith3, TP, Functor, T, Int);
defmethod(OBJ,  ginitWith3          , TP, Functor, T, Int) // generator
  retmethod(ginitWith3(galloc(TL),_2,_3,_4));
Esempio n. 5
0
// report methods
void MSIntTableColumn::breakProcess(MSIndexVector& i_)
{
  MSString buffer;
  MSInt aInt((int)(MSIndexedFunctions::computeIndexedFunction(vector(),weights(),i_,breakProcessMode())));
  breakString()<<aInt.format(buffer,format());
}