Example #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);
 }
Example #2
0
void Suite::AddScenario(Scenario* scenario) {
	safe_assert(scenario != NULL);
	scenarios_.push_back(scenario);
}
Example #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; 
}
Example #4
0
ExecutionTree* ExecutionTree::get_child(int i) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	return children_[i];
}
Example #5
0
	SETUP() {
		safe_assert(counter == NULL);
		counter = new NBCounter();
	}
Example #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);    
 }
Example #7
0
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();
}
Example #8
0
 bool is_struct() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxIsStruct(array);
 }
Example #9
0
 bool is_double() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxDOUBLE_CLASS;
 }
Example #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);
 }  
Example #11
0
 bool is_cell() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxIsCell(array);
 }
Example #12
0
 size_t size() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetNumberOfElements(array);
 }
Example #13
0
 const char* get_classname() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassName(array);
 } // end of is class
Example #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
Example #15
0
 double* get_double_array() {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetPr(array);
 }
Example #16
0
 bool is_uint32() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxUINT32_CLASS;
 }
Example #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()];    
 }
Example #18
0
 bool is_string() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetClassID(array) == mxCHAR_CLASS;
 }
Example #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());
 }
Example #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!");
 }
Example #21
0
void ExecutionTree::set_child(ExecutionTree* node, int i) {
	safe_assert(BETWEEN(0, i, int(children_.size())-1));
	children_[i] = node;
}
Example #22
0
 const mwSize* get_dimensions() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetDimensions(array);
 }
Example #23
0
thrID StrictTracker::pickNextSchedulingChoice(SchedPointInfo * s) {
    deadlockCheck();
    bool didNotGoPastEndOfReplayLog = false;
    safe_assert(didNotGoPastEndOfReplayLog);
    return INVALID_THREAD;
}
Example #24
0
 size_t cols() const {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return mxGetN(array);
 }
Example #25
0
bool RandomActiveTester::reenableThreadIfLegal(thrID thr) {
    safe_assert(active_testing_paused[thr]);
    active_testing_paused[thr] = false;
    disableThread(thr);
    return false;
}
Example #26
0
  const mwSize get_num_dimensions() const {
    safe_assert(array != NULL, "dereferenced null mxArray");
    return mxGetNumberOfDimensions(array);

  }
Example #27
0
void ExecutionTracker::gunlock() {
    safe_assert(Originals::pthread_mutex_trylock(global_lock) != 
            OPERATION_SUCCESSFUL);
    lock_count--;
    Originals::pthread_mutex_unlock(global_lock);
}
Example #28
0
 template<typename T>  T* get_data() {
   safe_assert(array != NULL, "dereferenced null mxArray");
   return reinterpret_cast<T*>(mxGetData(array));
 }
Example #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);
}
Example #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);
 }