vector.com|Contact
Search tips

apple banana
Find rows that contain at least one of the two words.

+apple +juice
Find rows that contain both words.

+apple macintosh
Find rows that contain the word 'apple', but rank rows higher if they also contain 'macintosh'.

+apple -macintosh
Find rows that contain the word 'apple' but not 'macintosh'.

+apple ~macintosh
Find rows that contain the word 'apple', but if the row also contains the word 'macintosh', rate it lower than if row does not. This is "softer" than a search for '+apple -macintosh', for which the presence of 'macintosh' causes the row not to be returned at all.

+apple +(>turnover >strudel)
Find rows that contain the words 'apple' and 'turnover', or 'apple' and 'strudel' (in any order), but rank 'apple turnover' higher than 'apple strudel'.

apple*
Find rows that contain words such as 'apple', 'apples', 'applesauce', or 'applet'.

"some words"
Find rows that contain the exact phrase 'some words' (for example, rows that contain 'some words of wisdom' but not "some noise words").

By continuing to use this site you agree to the use of cookies. For more information and to find out how to change this click here. Accept Cookies
Please enable cookies in your browser for this website.
Search:
Advanced search

Object Initialization User Code

Last updated: 2019-11-04

Object initialization user code serves two purposes. The first is to provide initial values to global constants and global references. The second to create the member initializer section of constructors that are defined by VectorCAST.
 

Global object example:

If a declaration looked like the following in the UUT, VectorCAST would need to initialize it at the point it defines it.
 

extern const int extern_global;
 

For example, const int extern_global; would cause a compile error. When we actually define it, we must provide an initial value to extern_global.

--

/*** BEGIN INITIALIZATION OBJECTS ***/
int SOME_VCAST_OBJECT;
/*** END INITIALIZATION OBJECTS ***/

const int extern_global

/*** BEGIN INITIALIZATION CODE ***/
= SOME_VCAST_OBJECT
/*** END INITIALIZATION CODE ***/


A similar process is applied to constructors:

class B : public A {
  public:
    B(int a);
    const int b;
};

/*** BEGIN INITIALIZATION OBJECTS ***/
int SOME_VCAST_OBJECT1;
int SOME_VCAST_OBJECT2;
/*** END INITIALIZATION OBJECTS ***/

B::B(int a)

/*** BEGIN INITIALIZATION CODE ***/
: A(SOME_VCAST_OBJECT1), b(SOME_VCAST_OBJECT2)
/*** END INITIALIZATION CODE ***/

{
 // body of B::B
}


You should have access to all of your types and global objects from within these user code types. The caveat is that you must know the scope of type of user code. Hopefully the examples above will answer your questions. If you want to see the actual place that the user code is inserted, open the S0000009.cpp file and search for "VCAST_INIT_OBJ". 
 

 
Article Options
2019-11-04
Views: 10