예제 #1
0
 int get_field_number(const char* field_name) const {
   safe_assert(is_struct(),
               "Attempted to access field of a non-struct element.");
   return mxGetFieldNumber(array, field_name);
 }
예제 #2
0
void Suite::AddScenario(Scenario* scenario) {
	safe_assert(scenario != NULL);
	scenarios_.push_back(scenario);
}
예제 #3
0
int ExecutionTracker::checkSemaphoreValue(sem_t * sem) {
    int a = -1;
    int * semval = &a;
    safe_assert(Originals::sem_getvalue(sem, semval) == OPERATION_SUCCESSFUL);
    return a; 
}
예제 #4
0
파일: dsl.cpp 프로젝트: panglong/concurrit
ExecutionTree* ExecutionTree::get_child(int i) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	return children_[i];
}
예제 #5
0
	SETUP() {
		safe_assert(counter == NULL);
		counter = new NBCounter();
	}
예제 #6
0
 void set_cell_index2d(const size_t i, const size_t j,
                       matwrap contents) {
   safe_assert(array != NULL, "dereferenced null mxArray");
   mxSetCell(array, i + j*rows(), contents.array);    
 }
예제 #7
0
파일: dsl.cpp 프로젝트: panglong/concurrit
bool ExecutionTree::child_covered(int i /*= 0*/) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	ExecutionTree* c = child(i);
	return c != NULL && c->covered();
}
예제 #8
0
 bool is_struct() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxIsStruct(array);
 }
예제 #9
0
 bool is_double() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxDOUBLE_CLASS;
 }
예제 #10
0
 matwrap get_cell(size_t index) const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   safe_assert(mxGetClassID(array) == mxCELL_CLASS,
               "Attempted to access a cell in a non-cell array.");
   return mxGetCell(array, index);
 }  
예제 #11
0
 bool is_cell() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxIsCell(array);
 }
예제 #12
0
 size_t size() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetNumberOfElements(array);
 }
예제 #13
0
 const char* get_classname() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassName(array);
 } // end of is class
예제 #14
0
 bool is_class(const char* classname) const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   safe_assert(classname != NULL, "Invalid classname argument");
   return mxIsClass(array, classname);     
 } // end of is class
예제 #15
0
 double* get_double_array() {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetPr(array);
 }
예제 #16
0
 bool is_uint32() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxUINT32_CLASS;
 }
예제 #17
0
 double& mat_index2d(const size_t i, const size_t j) {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetPr(array)[ i + j*rows()];    
 }
예제 #18
0
 bool is_string() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxCHAR_CLASS;
 }
예제 #19
0
 matwrap get_cell_index2d(const size_t i, const size_t j) {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetCell(array, i + j*rows());
 }
예제 #20
0
 void as_string(char* str_buffer, size_t buffer_len) {
   safe_assert(str_buffer != NULL, "NULL string buffer");
   int error = mxGetString(array, str_buffer, buffer_len);
   safe_assert(!error, "Error processing string!");
 }
예제 #21
0
파일: dsl.cpp 프로젝트: panglong/concurrit
void ExecutionTree::set_child(ExecutionTree* node, int i) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	children_[i] = node;
}
예제 #22
0
 const mwSize* get_dimensions() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetDimensions(array);
 }
예제 #23
0
thrID StrictTracker::pickNextSchedulingChoice(SchedPointInfo * s) {
    deadlockCheck();
    bool didNotGoPastEndOfReplayLog = false;
    safe_assert(didNotGoPastEndOfReplayLog);
    return INVALID_THREAD;
}
예제 #24
0
 size_t cols() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetN(array);
 }
예제 #25
0
bool RandomActiveTester::reenableThreadIfLegal(thrID thr) {
    safe_assert(active_testing_paused[thr]);
    active_testing_paused[thr] = false;
    disableThread(thr);
    return false;
}
예제 #26
0
  const mwSize get_num_dimensions() const {
    safe_assert(array != NULL, "dereferenced null mxArray");
    return mxGetNumberOfDimensions(array);

  }
예제 #27
0
void ExecutionTracker::gunlock() {
    safe_assert(Originals::pthread_mutex_trylock(global_lock) != 
            OPERATION_SUCCESSFUL);
    lock_count--;
    Originals::pthread_mutex_unlock(global_lock);
}
예제 #28
0
 template<typename T>  T* get_data() {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return reinterpret_cast<T*>(mxGetData(array));
 }
예제 #29
0
//TODO: locks or no?
void ExecutionTracker::waitWakeThread(thrID target) {
    log->waitWakeThread(target);
    sem_t * pause = wait_sem_map[target];
    safe_assert(pause != NULL);
    safe_assert(Originals::sem_post(pause) == OPERATION_SUCCESSFUL);
}
예제 #30
0
 matwrap get_field(const int field_id) const {
   safe_assert(is_struct(),
               "Attempted to access field of a non-struct element.");
   safe_assert(field_id < get_number_of_fields(), "Invalid field id!");
   return mxGetFieldByNumber(array,0,field_id);
 }