473,414 Members | 1,665 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Split A Macro (mockpp)

i am using a third-party library (mockpp), which comes in many macro for
use. for example

MOCKPP_CHAINER_FOR_EXT(MyMock, do, ext) myDo (&myMock);

it declared and initialized a 'myDo' object in a combined form. but i want to
seperate the declaration from initialization for some purpose. what will the
syntax likely be?
--
steven woody (id: narke)

Angelica Bell: What happens to us when we die?
Virginia Woolf: ... We return to the place we came from.
Angelica Bell: I don't remember where I came from.
Virginia Woolf: Neither do I.

- The Hours (2002)
Oct 29 '05 #1
4 2298
Steven Woody wrote:
i am using a third-party library (mockpp), which comes in many macro
for
use. for example

MOCKPP_CHAINER_FOR_EXT(MyMock, do, ext) myDo (&myMock);

it declared and initialized a 'myDo' object in a combined form. but i
want to seperate the declaration from initialization for some
purpose. what will the syntax likely be?


Have you tried looking at the headers to see how the macro is defined?
That would help, you know...

Try dropping the parentheses with the address of the 'myMock' thing.

MOCKPP_CHAINRE_FOR_EXT(MyMock, do, ext) myDo;

(that might create a declaration). If 'myDo' is a member, you will
need to initialise it in the c-tor's initialiser list. If it's not,
there is no initialisation, only assignment, after this.

V
Oct 29 '05 #2
"Victor Bazarov" <v.********@comAcast.net> writes:
Steven Woody wrote:
i am using a third-party library (mockpp), which comes in many macro
for
use. for example

MOCKPP_CHAINER_FOR_EXT(MyMock, do, ext) myDo (&myMock);

it declared and initialized a 'myDo' object in a combined form. but i
want to seperate the declaration from initialization for some
purpose. what will the syntax likely be?


Have you tried looking at the headers to see how the macro is defined?
That would help, you know...

Try dropping the parentheses with the address of the 'myMock' thing.

MOCKPP_CHAINRE_FOR_EXT(MyMock, do, ext) myDo;

(that might create a declaration). If 'myDo' is a member, you will
need to initialise it in the c-tor's initialiser list. If it's not,
there is no initialisation, only assignment, after this.


MOCKPP_CHAINER_FOR_EXT(...) is a #define, the above expanded to:

MyMock::FooBar myDo(&myMock);

so it seems clear the FooBar has to be constructed with a &myMock. if i
delcared it and initialize later, then the FooBar has to provide some method
leting me set in the &myMock. but i failed finding this information because
the library is toooooo complex and full of macro definitions.

--
steven woody (id: narke)

How Far You Fall Doesn't Matter, It's How You Land

- Haine, La (1995)
Oct 29 '05 #3
Steven Woody wrote:
"Victor Bazarov" <v.********@comAcast.net> writes:
Steven Woody wrote:
i am using a third-party library (mockpp), which comes in many macro
for
use. for example

MOCKPP_CHAINER_FOR_EXT(MyMock, do, ext) myDo (&myMock);

it declared and initialized a 'myDo' object in a combined form. but
i want to seperate the declaration from initialization for some
purpose. what will the syntax likely be?
Have you tried looking at the headers to see how the macro is
defined? That would help, you know...

Try dropping the parentheses with the address of the 'myMock' thing.

MOCKPP_CHAINRE_FOR_EXT(MyMock, do, ext) myDo;

(that might create a declaration). If 'myDo' is a member, you will
need to initialise it in the c-tor's initialiser list. If it's not,
there is no initialisation, only assignment, after this.


MOCKPP_CHAINER_FOR_EXT(...) is a #define, the above expanded to:

MyMock::FooBar myDo(&myMock);


How do you know? Did you look at the preprocessor output? What do
'do' and 'ext' mean?
so it seems clear the FooBar has to be constructed with a &myMock. if
i delcared it and initialize later, then the FooBar has to provide
some method leting me set in the &myMock.
If 'myDo' is a member of a class, you don't have a choice. A declaration
and an initialiser _have_to_ be separate.
but i failed finding this
information because the library is toooooo complex and full of macro
definitions.

My crystal ball is under the weather today, so I can't help you look it
up either. Sorry...
Oct 29 '05 #4
"Victor Bazarov" <v.********@comAcast.net> writes:
Steven Woody wrote:
"Victor Bazarov" <v.********@comAcast.net> writes:
Steven Woody wrote:
i am using a third-party library (mockpp), which comes in many macro
for
use. for example

MOCKPP_CHAINER_FOR_EXT(MyMock, do, ext) myDo (&myMock);

it declared and initialized a 'myDo' object in a combined form. but
i want to seperate the declaration from initialization for some
purpose. what will the syntax likely be?

Have you tried looking at the headers to see how the macro is
defined? That would help, you know...

Try dropping the parentheses with the address of the 'myMock' thing.

MOCKPP_CHAINRE_FOR_EXT(MyMock, do, ext) myDo;

(that might create a declaration). If 'myDo' is a member, you will
need to initialise it in the c-tor's initialiser list. If it's not,
there is no initialisation, only assignment, after this.

MOCKPP_CHAINER_FOR_EXT(...) is a #define, the above expanded to:

MyMock::FooBar myDo(&myMock);


How do you know? Did you look at the preprocessor output? What do
'do' and 'ext' mean?


i checked the headers for the difinition. MyMock is a mock class which was
gernerated to mocking a real object. so, the 'do' is a mehtod in the interface
of the real class. MOCKPP_CHAINER_FOR_EXE(...) used to create a object which
control how the mock object will behavior when the 'do' is called. and 'ext' is
just a text extension to prevent any possible name conflicts.
so it seems clear the FooBar has to be constructed with a &myMock. if
i delcared it and initialize later, then the FooBar has to provide
some method leting me set in the &myMock.


If 'myDo' is a member of a class, you don't have a choice. A declaration
and an initialiser _have_to_ be separate.
but i failed finding this
information because the library is toooooo complex and full of macro
definitions.

My crystal ball is under the weather today, so I can't help you look it
up either. Sorry...


might there are someone who know the MOCKPP ...
--
steven woody (id: narke)

Pepper...is hot and scorches, just like the sun

- Politiki kouzina (2003)
Oct 30 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

699
by: mike420 | last post by:
I think everyone who used Python will agree that its syntax is the best thing going for it. It is very readable and easy for everyone to learn. But, Python does not a have very good macro...
11
by: Carlos Ribeiro | last post by:
Hi all, While writing a small program to help other poster at c.l.py, I found a small inconsistency between the handling of keyword parameters of string.split() and the split() method of...
13
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my...
2
by: Pete | last post by:
In Access 95/97 I used to be able to create pull down menus (File,Edit ...) from a macro. It seems there used to be some wizard for that. However in Access 2000 it seems you have to build your...
3
by: Alexander Ulyanov | last post by:
Hi all. Is it possible to pass the whole blocks of code (possibly including " and ,) as macro parameters? I want to do something like: MACRO(FOO, "Foo", "return "Foobar";", "foo();...
4
by: carriolan | last post by:
Hi I have managed to secure a split database. Both frontend and backend share a common workgroup, common security groups and common users and permissions, but as in all good stories there is a...
2
by: AAOO (Sean) | last post by:
When I try to access the back end of a split database, I get the error message, that it's not trusted by access, and that I should move it to my computer, or an accessible network location? What...
2
by: elgin | last post by:
I have a split Access 2003 database. I have signed the database with a Code Signing Certificate from Small Business Server. This works fine and users can have Access macro security on high or...
1
by: sweeneysmsm | last post by:
Working in Access 2003, Windows XP Pro - (client not faithful to updates:(. I have succeeded in splitting a database. (I am actually working on a "test run copy" to insure that I am safe. My...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.